Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More information about errors #69

Open
oertels opened this issue Feb 19, 2018 · 1 comment
Open

More information about errors #69

oertels opened this issue Feb 19, 2018 · 1 comment

Comments

@oertels
Copy link

oertels commented Feb 19, 2018

When receiving an error like FETCH_ONE_ERROR, the meta data is lacking some information about the error type. For example, the appplication would act differently on an 404 (show a "not found" page), than on a 403 ("redirect to login"). Am I missing some option to achieve that?

@devvmh
Copy link
Owner

devvmh commented Mar 10, 2018

That's a good question. I think what you're describing is the headers of the error

The default ApiClient (https://github.com/devvmh/redux-crud-store/blob/master/src/ApiClient.js) doesn't pass along the headers of the error.

I have some plans in #38 to pass response headers along with responses, but I hadn't considered this for errors. It would certainly be a breaking change.

To get this working for your app, you can copy ApiClient.js into your project and modify it to pass the headers along with the error object. If you come up with a good way to do this, please submit your approach as a pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants