Skip to content

Commit

Permalink
feat: ignore 'CanceledError' from abortController.abort() invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-anderson committed Mar 5, 2024
1 parent d146cdc commit 207cd47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/services/httpService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ axios.interceptors.response.use(
return Promise.resolve(response.data);
},
async (error: AxiosError<OpenApiSchemas["Error"]>) => {
// Check if req was aborted:
if (error.code === "ERR_CANCELED") return Promise.resolve({ status: 499 });

// Check the error status code:
const errorStatusCode = error?.response?.status;

Expand Down

0 comments on commit 207cd47

Please sign in to comment.