From 326c63fc32748e2ba8dca478ee9b36a693579b89 Mon Sep 17 00:00:00 2001 From: zmcx16 Date: Sun, 22 Dec 2024 22:27:04 +0800 Subject: [PATCH] feat: print gpt other error --- .../gpt-investing-assistant/gptInvestingAssistant.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/gpt-investing-assistant/gptInvestingAssistant.js b/src/components/gpt-investing-assistant/gptInvestingAssistant.js index 49471664908d..340ed1a51a19 100644 --- a/src/components/gpt-investing-assistant/gptInvestingAssistant.js +++ b/src/components/gpt-investing-assistant/gptInvestingAssistant.js @@ -60,9 +60,13 @@ const GPTResponse = ({ GPTResponseRef, loadingAnimeRef, defaultOutput }) => { setGPTResponse(drawGPTResponse(false, resp_data["data"]["contents"].join("\n\n"))) } } else { - modalWindowRef.current.popModalWindow( -

Get GPT Response Failed, ret={resp_data["ret"]}

- ) + let err_msg = "" + if ("err_msg" in resp_data) { + err_msg = resp_data["err_msg"] + modalWindowRef.current.popModalWindow( +

Get GPT Response Failed. ({response.status}), err message={err_msg}

+ ) + } } } else if ("ret" in resp_data && resp_data["ret"] === -100) { modalWindowRef.current.popModalWindow(

Invalid OPENAI API KEY

)