Skip to content

Commit

Permalink
fix: Fixes undefined status error -- fixes #295 (#298 by @treeduship)
Browse files Browse the repository at this point in the history
  • Loading branch information
treeduship authored Aug 22, 2022
1 parent 582186f commit 278bfbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/apisauce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const getProblemFromError = error => {
if (axios.isCancel(error)) return CANCEL_ERROR

// then check the specific error code
if (!error.code) return getProblemFromStatus(error.response.status)
if (!error.code) return getProblemFromStatus(error.response ? error.response.status : null)
if (TIMEOUT_ERROR_CODES.includes(error.code)) return TIMEOUT_ERROR
if (NODEJS_CONNECTION_ERROR_CODES.includes(error.code)) return CONNECTION_ERROR
return UNKNOWN_ERROR
Expand Down

0 comments on commit 278bfbc

Please sign in to comment.