Update logic to read exception from api response
rickywid opened this issue · comments
Update logic to read exception from api response
Example:
If tries to signup with an existing email address. The client should read the server response and display the error message.
@rmjordas looks like we already had an issue for this and it was closed. Although the issue technically wasn't resolved - I've opened it again so we can re-visit it. I took a look at the code and this doesn't necessarily need a refactor for the http client class like I originally said - we just need to make sure we display the error message the api returns if the request fails.
You can reproduce by visiting the test/production environment and submitting the signup form with an existing email. The API returns the Error object. But we have hard coded the UI to display a different message which becomes confusing like someone pointed out in #general.
Here's the UI and message we display
Here's the message we should display. It isn't any better but that's an issue I can resolve on the backend.
If you can resolve this one - we will use it as a pattern to display api error messages for other api requests we make.