47 Handle application level 5XX errors
What's included
- apply toast notifications application wide for 5XX status
- updated naming on reducer tests and snapshots
Next round (if still needed)
- Messaging that recommends logging out, if 5XX errors continue to happen. This looks like it requires an additional component/reducer setup for alerts instead of trying to be crammed into an all in one under the toast component/reducer, and the toast reducer would start to deviate from simply maintaining state.
Alternate testing (the quick way)
The mock dev setup can be used to help provide a 503
. You'll still need to add a code snippet and go through the account add
modal to do a pretend submit.
- Open the code, go to this file
src/services/accountServices.js
and add this snippet@apiMock {ForceStatus} 503
to the code comments/annotations foraddAccount
. It should end up looking similar to this:/** * @apiMock {ForceStatus} 503 * * @api {post} /api/v1/account/ Post account * @apiDescription Add an account. * @apiDescription Use this endpoint to add an account. * * @apiParam ...
- After your edit start up the dev server through the terminal with a
$ npm start
- Next in the Cloud Meter interface click the
Add account
button and start going through the steps on the wizard. When you get to the final screen to fire the API calladdAccount
the toast notification should fire off.
Updates #47 (closed)
Edited by CD Cabrera