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

[Angular App] API error response incorrect when using GetAppConfiguration #4171

Closed
olicooper opened this issue Jun 1, 2020 · 1 comment
Closed

Comments

@olicooper
Copy link
Contributor

olicooper commented Jun 1, 2020

I have built the concept of a 'maintenance mode' for my API which returns a status code of 503. When the NGXS action GetAppConfiguration is dispatched the API call fails (which is expected)m but I also expected it to return the original headers and body of the error that was thrown. Instead I get statusCode: 0 which is then incorrectly identified by the error handler.

I have looked at the source code and I see this lines:

catchError(err => {
dispatch(new RestOccurError(new HttpErrorResponse({ status: 0, error: err })));
return throwError(err);
}),

This previously worked in my code on Abp v2.6.0 and was changed in this commit: 43e9cd2#diff-81ce61c98a835356c2c2f135c82a45ea

Is it possible you could return the original error unless it is an error that occurs after the API call?

@mehmet-erim
Copy link
Contributor

Thanks for reporting 👍 The original error response dispatched instead of the wrong error that status code is 0.

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

No branches or pull requests

2 participants