1616-10-04

Best practices in mobile UX design: Creating error messages!

Errors happen, in our apps and in our lives. Sometimes they happen because someone made a mistake, sometimes because a system failed. Whatever the cause, how your app handles errors has a big impact on how people experience it.

Lazy error handling and badly written error messages frustrate users and can make them stop using your app. Good error handling, on the other hand, can turn a moment of failure into a moment of help.

In this article, we’ll examine how the design of apps can be optimized to prevent excessive user errors and how to create good error messages.

What is an Error?

Errors (or error condition) occur when an app fails to complete an expected action, such as:

  • The application does not understand user input
  • The application fails
  • A user intends to run incompatible operations concurrently

Every error, regardless of who is to blame, becomes a point of friction for your users. Luckily, a well-designed error handling can help reduce that friction.

Preventing User Errors

If you design web or mobile apps, you work with constraints. For example, a form can be hard to fill out, or data can fail to sync on a poor network connection. Take these constraints into account and design an app that is easy to use. In other words, it’s better to prevent errors in the first place by offering suggestions, using constraints, and being flexible.

X (formerly Twitter) is a well-known example. It has a strict character limit for posts and warns people before they go over it with a remaining character count.

twitter error message best practice

Make Error Message Informative and Consistent

One of Jakob Nielsen’s 10 usability heuristics is to help users recognize, diagnose and recover from errors. An effective error message does three things:

  • Communicate what is happening
  • Describe how a user can resolve it
  • Preserve as much user-entered input as possible

By providing explanation and feedback, you can decrease the potential friction of user experience.

User Input Errors

User input validations are meant to have conversations with users and guide them through the difficult times of errors and uncertainty. The output of this process is emotional rather than technical.

The main principle of input validation is simple: talk to your users and tell them what is wrong. Good form validation has three parts:

  • Right time and place for informing about errors
  • Right color for the message
  • Clear language for your message

All three have the same goal: avoid confusion.

Right Time and Place (Inline Validation)

Users dislike when they go through the process of filling out a form only to find out at submission, that they’ve made an error. The right time to inform about the success/failure of provided data is right after the user has submitted the information. And it’s a time when real-time validation comes into play.

Real-time inline validation immediately informs users about the correctness of provided data. If you are performing inline form validation, and the field with the error is clearly marked, the submit button may be disabled until the error is corrected. It allows users to correct the errors they make faster without having to wait until they press the submit button to see the errors.

Google Error Messages
Image credit: Google

Below are a few examples of inline validation:

  • Incompatible values
incompatible values error messages
An example of errors detected before form submission. Image credit: Material Design
  • Over/under character or word count
input field error messages
An example of an input field with character counter and error text. Image credit: Material Design

Right Color (Intuitive Design)

Color is one of the best tools to use when designing validation.

Because it works on an instinctual level, adding red to error messages and yellow to warning messages is incredibly powerful. Error text should be legible, with noticeable contrast against its background color. But make sure that colors in your digital interface are accessible for your users, it’s a really important aspect of a well-executed visual design.

color error message
Make people notice the message. Image credit: Material Design

Clear Message (What Happened)

Make sure your error messages sound like they’ve been written for humans. In order to achieve this you should speak the same language as your users, avoid using technical jargon, express everything in the user’s vocabulary. Your validation message should clearly state:

  • What went wrong and possibly why.
  • What’s the next step the user should take to fix the error.
mobile error messages
A typical error might state that “the data is invalid” without telling the user why it’s invalid (Is it a typo? Is it occupied?). Make sure the message is clear. Image credit: Material Design

App Errors

App errors occur independently of user input. It is an example of a situation where the user is getting something other than their desired state. When showing errors, explain why user cannot see anything, and how to solve this.

Sync Error/Failure To Load

When sync or connectivity is down or content has failed to load, tell the user upfront. Since you don’t have data to show, use the empty state to fill the gap. Sadly, most empty states look… empty. In the example below, the screen only says “An error occurred” and gives no helpful information.

spotify error message
Dead-end empty state. Image credit: Spotify

And when errors do slip through to users, a visual bug reporting tool helps your team see exactly what went wrong. A screenshot with annotations, or a screen recording, beats a vague error description every time.

Think of your error message as a conversation with your user. Use friendly and helpful empty states in a moment of failure. Assist users by providing the basic required information, and encourage users to solve the problem.

mobile error message
Feel lost and unconnected, like you are on a deserted island? Follow the advice, keep calm, light a fire, and keep refreshing. Image credit: Azendoo

If appropriate, present a link (or button) to help a user accomplish their task. But you should only offer options that you can actually support. For example, don’t offer an option like “Try again” in cases where you can detect that the operation will fail.

Or if the case is a loading time issue, make sure you have a progress indicator in place.

Never Show The Raw Error Message

Messages like the example below are cryptic and scary.

mobile error messages developer
This error message was written by a developer for a developer.

Don’t assume people know about the context of a message or they are tech-savvy, tell people what’s wrong in simple words. How would you explain the error to them, in human speak? Write those words down. That’s your error message.

Incompatible State Errors

Incompatible state errors occur when users attempt to run operations that conflict, such as making a call while in airplane mode or trying to play online video while being offline. You should help prevent users from putting themselves into these situations by clearly communicating the states they are selecting. Simply, don’t let people start something they can’t finish.

mobile error messages
Clarify the reason for and origination of the error. Image credit: Material Design

Designing the best error messages

The best error message is the one that never shows up. Prevent errors where you can by guiding users in the right direction ahead of time. When errors do happen, good error handling teaches people how the app works and keeps them from feeling stupid.

Some errors only show up when real people use your product. Usersnap is a product evidence platform that connects what people say, what you build, and how it lands. Users report a problem from an in-app widget, and the report arrives with a screenshot, browser and device details, and the page URL, so your team can reproduce it. Try Usersnap free, no credit card needed.

About the author:

This post originally appeared on babich.biz, written by Nick Babich, a software developer who’s passionate about user experience.

Trust what AI tells you about your customers

Usersnap evidence traceability

Most product teams have been burned by an AI summary nobody could trace back to a real customer. Usersnap scopes every AI output to the evidence actually collected in your workspace, so each insight, hypothesis and sentiment score links back to the comment that produced it.

  • Open the source behind any claim, instead of guessing what the model assumed.
  • Keep your data yours. Customer data is never used to train AI models, and AI features can be switched off per account.
  • Stay inside the EU. GDPR compliant, hosted on AWS in Frankfurt and Ireland.

Put it against your own feedback before you commit. Start free or get a custom trial with our team.