Skip to content

Commit

Permalink
AbortSignal should result in a status code 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Jul 12, 2024
1 parent b5b2169 commit aa37e27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fetch-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default async function fetchWrapper(
let message = "Unknown Error";
if (error instanceof Error) {
if (error.name === "AbortError") {
(error as RequestError).status = 500;
(error as RequestError).status = 0;
throw error;
}

Expand Down
2 changes: 1 addition & 1 deletion test/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
} catch (error) {
expect(error.name).toEqual("AbortError");
expect(error.message).toEqual("The operation was aborted.");
expect(error.status).toEqual(500);
expect(error.status).toEqual(0);
}
});

Expand Down

0 comments on commit aa37e27

Please sign in to comment.