Skip to content

47 Handle application level 5XX errors

CD Cabrera requested to merge cdcabrera/frontigrade:47-application-errors into master

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.

  1. Open the code, go to this file src/services/accountServices.js and add this snippet @apiMock {ForceStatus} 503 to the code comments/annotations for addAccount. 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 ...
  2. After your edit start up the dev server through the terminal with a $ npm start
  3. 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 call addAccount the toast notification should fire off.

Screen_Shot_2018-07-12_at_4.48.19_PM

Updates #47 (closed)

Edited by CD Cabrera

Merge request reports