Avoiding and handling errors

Before you handle errors, try to avoid them. The more errors you can handle and remove during development, the happier your users will be. Here are some ways you can avoid errors:

  • As you design your app, test it with target users and adjust the workflow to help users avoid errors.
  • Prompt users with default values.
  • Create fields of a size that reflects how much information users should enter.
  • Be flexible with formats. For example, for phone numbers, accept (519) 555-0199, 5195550199, and 519-555-0199.

If you need to inform users of an error

Carefully consider whether you need to inform users of an error. If you do, do it in the least disruptive way you can.

Inline notifications

Device showing an inline error.

Inline notifications keep users in the context of a task and don't force users to respond before continuing.


A user entered an improperly formatted email address.

A user entered an incorrect password.


Attach the notification to the affected item. You can add a subtle animation to show where the error is.


Toasts are useful when an inline notification isn’t possible. Toasts also let users to continue without stopping what they are doing.


An image didn't upload successfully.

New messages don't appear because the device isn't connected to a wireless network.


Display a toast on the screen. The toast should disappear after 3 seconds.

Device showing a toast that displays an error message.

Dialog boxes

Device showing a dialog box that displays an error message.

Dialog boxes are essential when users must acknowledge an error before they can move forward.


Restarting an application.


Display a dialog box that users must respond to before they can continue.

Best practices

Tell users about errors as soon as you can. If a user enters an incorrect phone number, you can display an inline notification as soon as they leave the text field.

Keep action buttons inactive (such as Send, Share, or Next) until users enter the required information and it's validated.

Suggest a solution. Don't just state the problem; help users recover. For example, a BlackBerry device isn't connected to a wireless network, you can prompt the user to connect to a Wi-Fi network.

Offer to fix issues that affect performance. If a user has many browser tabs open, you can suggest closing some tabs to improve browsing.

Don't tell users that an action was successful. Let them feel confident in the success of their actions.

Don't reset values that users enter unless the values are confidential, such as passwords.

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus