Skip to content

Commit

Permalink
feat: print gpt other error
Browse files Browse the repository at this point in the history
  • Loading branch information
zmcx16 committed Dec 22, 2024
1 parent 16935ef commit 326c63f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/gpt-investing-assistant/gptInvestingAssistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ const GPTResponse = ({ GPTResponseRef, loadingAnimeRef, defaultOutput }) => {
setGPTResponse(drawGPTResponse(false, resp_data["data"]["contents"].join("\n\n")))
}
} else {
modalWindowRef.current.popModalWindow(
<h2>Get GPT Response Failed, ret={resp_data["ret"]}</h2>
)
let err_msg = ""
if ("err_msg" in resp_data) {
err_msg = resp_data["err_msg"]
modalWindowRef.current.popModalWindow(
<h2>Get GPT Response Failed. ({response.status}), err message={err_msg}</h2>
)
}
}
} else if ("ret" in resp_data && resp_data["ret"] === -100) {
modalWindowRef.current.popModalWindow(<h2>Invalid OPENAI API KEY</h2>)
Expand Down

0 comments on commit 326c63f

Please sign in to comment.