Skip to content

Commit

Permalink
Fix axios error code
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyballentine committed Jul 9, 2024
1 parent 0c6fe69 commit 7923db1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common/Backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,13 @@ export class Backend {
if (error.response?.data) {
return error.response.data as T;
}
if (axios.isCancel(error)) {
// Note: Don't use axios.isCancel as it is currently bugged
if (error instanceof axios.CanceledError) {
throw CancelError.fromCancel(error, error.config);
}
if (error instanceof axios.AxiosError) {
throw error;
}
assertNever(error);
}
if (ServerError.isJson(error)) {
Expand Down

0 comments on commit 7923db1

Please sign in to comment.