projectunic0rn / pub

Where developers from around the world partner to build and ship software for fun, for learning, or for profit.

Home Page:https://projectunicorn.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
Screen Shot 2020-02-11 at 5 12 19 PM

Here's the message we should display. It isn't any better but that's an issue I can resolve on the backend.
Screen Shot 2020-02-11 at 4 52 23 PM

If you can resolve this one - we will use it as a pattern to display api error messages for other api requests we make.