-
Notifications
You must be signed in to change notification settings - Fork 183
Raise client error for unhandled 4xx responses #311
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
Raise client error for unhandled 4xx responses #311
Conversation
This looks solid. Thank you so much for the contribution! Can you take a look and see if the test failures are due to your changes? |
Doesn't look like it. Looks like some kind of test file load order thing. |
@jamesstonehill those are the worst. Alright. Rerunning seems to have fixed it. I'll take a look later. Thanks! |
Oh. One last thing: can you add a description to the |
@jamesstonehill 1.6.2 is live |
This is causing 422 errors are usually used for resource validation errors, should that particular status be excluded from the ClientError? |
That's not excellent. How would everyone feel about explicitly defining every 4xx error as its own error class? |
Why was that reverted? Raising an error may not be the best way to handle a 422 but it's far better than failing silently. |
I think most people would expect To not break compatibility for now, the easiest would be to not raise on |
Yeah, that's a good point. Since these responses would populate the model errors raising probably isn't right here. Probably best to revert. |
@jamesstonehill I think raising on the other 4xx errors is appropriate, it's just the 422 that should be ignored. |
Are there any other 4xx statuses that might return validation errors? |
I'm not sure if there are other statuses that might return validation errors, and the json api spec isn't specific about the 4xx errors, but 422 seems generally accepted. |
I think it's reasonable to allow them as they come up |
Resolves #308