Skip to content

Commit

Permalink
check res.code
Browse files Browse the repository at this point in the history
  • Loading branch information
jackluson committed Nov 25, 2024
1 parent a80926f commit 71beb89
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/shared/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ export function checkCloudflareResponse(
result: res,
});
} else {
const defaultErrMsg = res?.message?.toLowerCase().includes?.(scene)
? res?.message
: `${scene} fail, please try again.`;
const defaultErrMsg =
res?.message?.toLowerCase().includes?.(scene) || res?.code ? res?.message : `${scene} fail, please try again.`;
callback({ isOk: false, code: res?.code, msg: defaultErrMsg, result: res });
}
}
Expand Down

0 comments on commit 71beb89

Please sign in to comment.