diff --git a/api_webchat/model-worker-openai.js b/api_webchat/model-worker-openai.js index f0277c1d..5ebb3e4e 100644 --- a/api_webchat/model-worker-openai.js +++ b/api_webchat/model-worker-openai.js @@ -90,11 +90,12 @@ self.onmessage = async function(event) { if (!response.ok) { let error_message = ''; + let errorDetail = ''; if(response.is_exception === true){ error_message = response.error; }else{ const errorJSON = await response.json(); - const errorDetail = JSON.stringify(errorJSON); + errorDetail = JSON.stringify(errorJSON); error_message = errorJSON.error.message; //console.log(">>>>>>>>>>>>> errorJSON.error.message: " + JSON.stringify(errorJSON.error.message)); }