Skip to content

Commit

Permalink
fix: add api fetch error reason
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Jul 2, 2024
1 parent 77328ef commit 37efb0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/renderer/src/lib/api-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const getFetchErrorMessage = (error: Error) => {
const json = JSON.parse(error.response?._data)
// TODO get the biz code to show the error message, and for i18n
// const bizCode = json.code
return json.message || error.message
const { reason } = json
return `${json.message || error.message}${reason ? `: ${reason}` : ""}`
} catch {
return error.message
}
Expand Down

0 comments on commit 37efb0b

Please sign in to comment.