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
HttpErrorResponse#error is not instance of Error in client-side/network error #18690
Comments
I can confirm this issue which is currently affecting me. Backend sends an 413 PAYLOAD_TOO_LARGE Error which is identified by Angular as a ProgressEvent. Therefore, the Http Status / Error Message are gone. |
Reason for closing this issue? I don't see a solution to this issue, as i am also experiencing this. |
was having this too, this way of catching it fixed it: |
In case the solution above is not working for you. In my case, it was a matter of CORS. For the exact same code, locahost was not working but test environment was. It seems that even though browser knows it is a 500 status code, let's say, however, the CORS policy makes weird stuff with the request. You can either: Hope this info helps others! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
According to document (https://angular.io/guide/http#getting-error-details), if client-side or network error occurred,
HttpErrorResponse#error
is instance ofError
. But when I tried this behavior with CORS error,HttpErrorResponse#error
is instance ofProgressEvent
.Expected behavior
fix document to describe correct way to distinguish client-side/network error or backend returned 4xx/5xx.
Minimal reproduction of the problem with instructions
http://plnkr.co/edit/7f96LrlQyFknX28QDzrN
What is the motivation / use case for changing the behavior?
Due to this problem, I don't know the way to distinguish http request is failed by client-side or backend returned 4xx or 5xx.
Environment
The text was updated successfully, but these errors were encountered: