Skip to content

Consistently display error messages from backend  #1943

Closed as not planned
Closed as not planned
@presleyp

Description

@presleyp

As was done in the usersXService, we should go through the frontend and make sure all error messages from the API are being unpacked properly to avoid over-reliance on default error messages, or displaying unhelpful error messages (the error has a less helpful message than the response). getErrorMessage and getFormErrors help with this.

To be done

  • convert this to an epic
  • create issues for each XService

Problem

The frontend does not always display the error messages sent from the backend, and even when it does, it does not display the detail that is sometimes sent along with it.

Definition of done for each ticket

  • There are no uses of displayError in this XService. To replace the error snackbar, render ErrorSummary in the relevant components with the dismissible prop. This way, the user can expand the error detail if desired without the snackbar disappearing on them.
  • There are no uses of getFormHelpers in the relevant components; switch to getFormHelpersWithError even if no error. (We will eventually rename it to replace the original getFormHelpers.)
  • The XService always assigns the API error, rather than a hard-coded error message. If a hard-coded error message is needed as a fallback, send it as a prop to ErrorSummary.
  • Errors are only unpacked in ErrorSummary and getFormHelpersWithError.
  • Storybook has a story for when the error(s) are showing.

Tickets

Metadata

Metadata

Assignees

No one assigned

    Labels

    siteArea: frontend dashboard

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions