Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Quality busters: Make your error messages meaningful

Develop messages that make sense to both users and programmers

Michael Russell (MikeRussell@VickiFox.com), Application Architect, Vicki Fox Productions, Inc.
Photo of Michael Russell
Michael Russell has a bachelor's degree in physics and a master's degree in computer science. He was a logistics engineer, a technical services manager, and a certified IT architect at IBM for nearly 14 years. He is currently a Web application architect for a resort company in Orlando. He has experience in Windows, UNIX, and OS/400 environments. He uses Web technology for entertainment through his own company, Vicki Fox Productions (http://www.VickiFox.com).

Summary:  Many applications treat users as if they were programmers. Messages that report errors are often cryptic, contain meaningless codes, and provide no help regarding what to do next. While the developers who wrote the application can use those messages, most users are left with one option: call the help desk. This article describes a more appropriate kind of error message for users: one that includes description, cause, and recovery steps.

View more content in this series

Date:  20 Oct 2004
Level:  Introductory

Activity:  5556 views
Comments:  

In this installment of the Quality busters series, I look at one aspect of application usability: error handling. Usability is a non-functional requirement that is often overlooked or ignored because of lack of funding, time, resources, understanding, and more.

What does MissingResourceException mean?

The SHEEP application team had finished deploying their new internationalized version of the application's rich client component. This new version allowed the user to select between English, Spanish, and German versions of the panel field labels.

During deployment, a spelling error in the name of the German resource bundle occurred in the configuration properties file. This was not detected until a user tried to select German and received the dialog window shown in Figure 1.


Figure 1. Example of a meaningless error message
Example of a meaningless error message

The user called the help desk and asked, "What does MissingResourceException mean?" The help desk didn't know and forwarded the problem to the SHEEP application team. The lead developer immediately recognized the problem:"Oh, the German resource bundle is missing. Either the file is missing or the configuration is wrong. I'll look into it."


All that wasted time

Generally, error messages delivered to a user fall into two broad categories -- user-caused and environment-caused.

  • User-caused errors are notifications of incorrect program usage, such as invalid input data. Messages to the user should provide enough information to allow the user to fix the problem.
  • Environment-caused errors are notifications of problems with computing resources, such as out-of-memory errors or problems that arise when the system is unable to access a server. Messages to the user should resolve the problem.

Regardless of the category, if the message does not provide sufficient information about the problem -- likely causes, runtime details, configuration information, and a suggested recovery process -- then the user wastes a lot of time, and consumes a lot of help center and programming resources working on problems that the user could have solved given enough information through messages. While the application team might save money by keeping user messages simplified during development, the team ends up spending far more money on application support to solve minor problems.


Different audience, different needs

Developers can cite many reasons why applications might have error messages that are meaningless from a user perspective:

  • One cause might be developers ignoring the user's perspective. Developers create messages from their own perspective. Because they know the code in detail, they do not need redundant information in an error message. Location, exception name, and some field values are usually sufficient for a developer. But a user has none of this knowledge. As a result, these error messages are meaningless to a user.

  • Another cause might be the lack of powerful user-oriented error-reporting facilities. Many packages and language APIs support logging messages, but few support user-oriented messages.

  • Also, user-friendly error messages are difficult to develop. Generally, doing it well requires usability testing of the application and messages.

To produce a high-quality application, it's important for the application architect to remember that the user interface, which includes error messages, is for the users, not the developers.


Proposed alternatives

In this section, I cover some tips on making your own error messages user friendly.

Contents

Useful error messages should contain at least the following information:

  • Message ID. This is a unique message identifier associated with a specific error. The message ID can function as an index into a procedures manual or a reference within a user's guide. If the message is translated into other languages, the identifier remains constant and thus can be consistently used to report errors. Most IBM software products have message IDs associated with errors; for instance, message AMQ4023 means that "The queue manager does not exist on this computer" in the WebSphere® MQ product.

  • Timestamp. This is the date and time at which the error occurred. The help center or developers can use this information to correlate the error with information in log files.

  • Message type and severity. Indicate whether the message is informational or reporting an error. You can divide errors into automatically recoverable errors, manually recoverable errors, and non-recoverable errors.

  • Process and thread details. Show the identity of the effective user associated with the process, the identity of the process itself, and the identity of the active thread. These are details that will help developers troubleshoot the problem.

  • A short message. Present the user with a short form of the error message. This is a compromise to balance the needs of advanced users and novice users.

  • A detailed message. Permit the user to view detail information about the error if he chooses to do so.

  • Program state and configuration. Instead of showing program stack information, which is not particularly useful to the user and belongs in the program log files anyway, show current program field values and applicable configuration information in the message. For example, don't say, "Queue manager not found"; say "Queue manager PHRED not found." Include information that is relevant to the user. If the error was caused by the user entering incorrect information, repeat the value that the user entered incorrectly. If the error was caused by a misconfigured component, display configuration information so that the user knows what the program was expecting.

  • Likely causes. Offer an explanation of likely causes of the error. Write the description in user terminology, not programmer terminology.

  • Corrective action or recovery. Provide instructions on how to recover from the problem. In some cases, these will instruct the user to contact the help center.

Presentation

As you can see, even useful error messages will have a lot of information that can overwhelm a user. Therefore, you want to deliver the information in pieces, providing a way for the user to display just as much as he or she needs at any given moment. The initial dialog panel would show the basic information, as illustrated in Figure 2, and a subsequent dialog panel can show detailed information, as illustrated in Figure 3.


Figure 2. Sample basic error message dialog
Sample basic error message dialog

Figure 3. Sample detail error message dialog
Sample detail error message dialog

Programming design

Remove as much of the user message text as possible from the program and move it to external objects, such as resource bundles, text files, or even database tables. Because the text is external to the program, it's possible to replace that text with local language translations, thus enabling the program for international use.

If possible, create and use a very clean message delivery API that the programmers can use in the application. The messages should show program state and configuration written to the message delivery API. One way to support this is to have the messages in the external message description objects support substitution parameters. The message delivery mechanism replaces these parameters with information passed from the program.

Listing 1 shows an example of how this might be done in the Java language.


Listing 1. Sample user error message API
//-- error occurs
userMessageDelivery.send( 'UDU0149',
MessageDelivery.ERROR,
MessageDelivery.RECOVERABLE,
new Object[] { parm1, parm2 } );

The message ID identifies the message. The message type indicates an ERROR. The message severity indicates that this error is recoverable. Finally, an object array of parameter values provides the values for the substitution parameters in the underlying message.


Considerations

When building an interactive application, an architect starts by asking the following questions:

  • Does the project plan include usability testing and analysis?

  • What is the skill level of the user community? If the primary audience is programmers, as is the case with many open source products, then less information in error messages can be tolerated. However, with commercial products used by a wide range of users, plan to make more information available.

  • Is the application targeting an international audience for which messages will be translated into local languages? This necessitates moving message text out of the program and into external objects, such as resource bundles in Java environments.

  • Are there commercial products or open source code available to implement a more useful error reporting mechanism?


In summary

When users encounter a problem and are presented with poorly designed error messages, the results are user frustration, user rejection of the program, and increased support costs from user dependence on the help desk. Error reporting is an often-overlooked aspect of the total user experience. This article has proposed a minimum standard of contents and design for user error messages.


Resources

  • Read the author's other articles in the Quality busters series on developerWorks.

  • The author derived many of the ideas for the proposed message contents from the message facility of the OS/400 (and OS/i5) operating system that is used on the IBM eServer iSeries (and i5) family of computers. IBM Application System/400 Technology is a book that came with the announcement of the AS/400 series, the successor of the System/38 and predecessor of the iSeries and i5 series. The book includes articles about the user interface and application design using the message file, message description, and message queue objects.

  • Get the details on the usability analysis underlying the radically different command language and user screen design of the System/38 operating system and application screens from "The Design Rationale of the System/38 User Interface," J.H. Botterill IBM Systems Journal, 1982).

  • Explore a pioneering work on GUI application design drawn from experiences learned especially using Apple Computer systems in Tog on Interface by Bruce Tognazzini (Addison-Wesley, 1992).

  • Check out the first book anyone preparing for usability analysis of an application should read, Usability Engineering by Jakob Nielsen (Morgan Kaufmann, 1994).

  • Discover how usability decisions impact users in Don't Make Me Think: A Common Sense Approach To Web Usabilityby Steve Krug (New Riders, 2000).

  • Find guidelines on how to avoid common error message problems in GUI Bloopers: Don'ts and Dos for Software Developers and Web Designers by Jeff Johnson (Morgan Kaufmann, 2000).

  • Visit these valuable resources on developerWorks:

About the author

Photo of Michael Russell

Michael Russell has a bachelor's degree in physics and a master's degree in computer science. He was a logistics engineer, a technical services manager, and a certified IT architect at IBM for nearly 14 years. He is currently a Web application architect for a resort company in Orlando. He has experience in Windows, UNIX, and OS/400 environments. He uses Web technology for entertainment through his own company, Vicki Fox Productions (http://www.VickiFox.com).

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Web development
ArticleID=23514
ArticleTitle=Quality busters: Make your error messages meaningful
publish-date=10202004
author1-email=MikeRussell@VickiFox.com
author1-email-cc=htc@us.ibm.com

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers