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

Error not displayed after 400 response #1059

Open
josephwmorse opened this issue May 6, 2016 · 8 comments
Open

Error not displayed after 400 response #1059

josephwmorse opened this issue May 6, 2016 · 8 comments

Comments

@josephwmorse
Copy link

If the server returns a 400 response, the response body (or any other error message) is not displayed. The user is left wondering why their request did not go through. If the server returns a 200, a success message is displayed correctly.

This is on 1.0.0-alpha4

@josephwmorse
Copy link
Author

Assuming this is related to #1036

@Phocea
Copy link
Contributor

Phocea commented May 10, 2016

Might not be related to the translation problem.

Have a look at #1031, only 404 is capture by ng admin, any other error will come up a "state changed error".

You may also need to change your config to be able to read the error message your are sending back in your API, see https://github.com/marmelab/ng-admin/blob/master/doc/Theming.md#customizing-error-messages

@josephwmorse
Copy link
Author

I think this issue is related to #1036 since I am not seeing any state change errors. I think it also may be related to the fact that my API returns a string instead of an object in the response body when an error occurs.

I was able to work around the problem initially by implementing the fix highlighted in #1036, removing the typeof error.data === 'object' check, and providing a translation for the ERROR_MESSAGE key. But your example from #1031 is better - writing my own response interceptor works just as well and does not require any modifications to the library.

@Phocea
Copy link
Contributor

Phocea commented May 11, 2016

Great.
Beware that the ng admin ErrorHandler $stateChangeError event will still fire after your own interceptors. So this is only a small workaround until we have a way of overriding the default behaviour

@KonstantinYegupov
Copy link

The issue is still there. It's a terrible UX - silently swallowing an error. Is it being worked on?

@RichardBradley
Copy link
Contributor

My PR #1130 might fix some or all of this?

@Phocea
Copy link
Contributor

Phocea commented Nov 18, 2016

Related to #1245

@Phocea
Copy link
Contributor

Phocea commented Jan 26, 2017

Partially fixed by #1273

Related to #1300

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

4 participants