Skip to main content

Error Handling

Notifications are an important method of communicating with users and providing feedback. Error notifications in particular must be using the correct design pattern and well written wording to explain what went wrong and how to fix it.

Notification Types

Notifications range in their priority and therefore should vary in their disruptiveness to users. It is important to match the urgency and priority of the information being communicated to the visual style and behavior of the notification. It’s important to avoid “dead-end” scenarios, in which users can’t accomplish their task. The last resort should be to redirect the user to a customer support page.

Deciding what to use

Cause of errorTypeInteraction
4xx Errors (e.g. 404 not found)Error PageButton which redirects to home (e.g. Dashboard).
5xx ErrorsSnackbar (persistent)Users can manually clear the error message and try again.
User inputForm error messageUsers can correct their input errors. Error message stays visible until solved.
User input which causes an error in other parts of the form (e.g. 4xx POST, PUT errors)Form error message and Banner message.Users can correct their input errors. Error message stays visible until solved. Banner stays visible until submitting the form again.
Missing dataEmpty State(Optional) buttons to reload, or links to documentation.

Dedicated Error Page

Error pages are used for critical errors where no alternative content can be provided. That applies to almost all 4xx client errors. Error pages feature an Empty State with clear messaging and a button that provides “a way out” – for example a redirect to the home page, or navigation to the previous page.

404 Error Page

A dedicated 404 error page which contains an Empty State, and a button that redirects to the home page.

403 Error Page

A dedicated 403 error page which provides a helping hint to the user.

Persistent Snackbar Errors

Snackbar notification should be used for system errors (5xx, whenever something goes wrong on GET, POST, PUT, DELETE requests). The snackbar item should be persistent, but dismissible, and error messages of the same type should not stack.

500 Error Snackbar

Form Errors

Form error messages are shown when the user enters data in forms that don't match the validation rules of an input element. Validate the input as soon as a field loses focus. Input error messages should disappear when the requirements are met.

Form Validation

For server-side validation, a form error message should appear underneath the affected input elements, as well as an additional Banner at the top of the form. This does typically apply to 4xx POST/PUT errors.

Empty States

Inline empty states (e.g. within a table, or dashboard tiles) are not exactly error messages, but should always be used whenever there is no data available.

Empty State Page

Messaging

It’s important to consider the user’s context when writing notification messages. Use language that is accessible to the user and that will be easily understood. Use a tone that is appropriate for the situation and notification. Try to offer a way to solve the issues.

Best practices and examples

Best Practices