art-emini / AxleJS

Fetch, supercharged.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unusable in production due hardcoded status handling

Pyrolistical opened this issue · comments

Due to https://github.com/ksplatdev/AxleJS/blob/main/src/utils/handleStatus.ts#L6 users of this library are unable to have custom handling of error status codes.

How would you think it should be instead?

Checkout how Axios does it. it throws an error object with an optional response field if its an error that happened after the response was received https://github.com/axios/axios#handling-errors

Commit 65d3188 should fix this.

AxleJS Test on Codesandbox has the build from that commit.