-
Notifications
You must be signed in to change notification settings - Fork 366
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
Why is errorStatus 400+ considered a success? #202
Comments
Exceptions (what |
Thank you for your response @zoechi. Correct, as you've said, only few of 4XX codes are considered errors. My question was probably not clear enough, but at least that means the implementation returns success in case of I think 404 is nothing else as error. Opening a network tab in developer options in your browser will also suggest, hitting 404 is considered to be an error. Citing W3 standard file points into exactly same direction:
And therefore is the implementation of continuing in case of 4XX for specific numbers wrong. |
I don't see why 404 would be an error. The client makes a request and responds that the connection could not be established. That's quite a common request/response scenario, like Caller: Operator please connect me to 12345. Don't you think the 3rd line is redundant. That's how I see an exception for 404. |
The interceptor needs to decide which status codes it wants to treat as errors - it isn't up to the HTTP package to turn results into exceptions based on their status code. You could write an interceptor that will check |
Hi.
I've been trying to implement the http interceptor exactly as you've explained to another person in #89 .
I've created my own inherited class and updated
send
function. In any case (with using my own class or just running httpClient.get), where httpClient isnew Client();
,Running this command:
returns success.
Why is that so? Why do I not land in
catchError
? That also means, if trying to use my own interceptor:What is then the correct way of implementing error response interceptor?
The text was updated successfully, but these errors were encountered: