Skip to content

Commit

Permalink
fix: correctly handle error message
Browse files Browse the repository at this point in the history
  • Loading branch information
lynchee-owo committed Mar 19, 2024
1 parent 9b3a4fe commit d0d24a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/determineNextAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ ${labelData.map((item) => tomlLikeStringifyObject(item)).join("\n===\n")}`;
// TODO: need to verify the new API error format
console.error("determineNextAction error:");
console.error(error);
if (error.includes("server error")) {
if (error.message.includes("server error")) {
// Problem with the OpenAI API, try again
if (notifyError) {
notifyError(error);
Expand Down Expand Up @@ -222,7 +222,7 @@ export async function determineNextAction(
// TODO: need to verify the new API error format
console.error("determineNextAction error:");
console.error(error);
if (error.includes("server error")) {
if (error.message.includes("server error")) {
// Problem with the OpenAI API, try again
if (notifyError) {
notifyError(error);
Expand Down

0 comments on commit d0d24a1

Please sign in to comment.