Main Menu

Development

Application error messages, write good ones and make sure they are seen!

on June 16, 2017

In 1995, a cruise ship ran aground because of insufficient error handling. Well, kind of.  That is not the whole story but for the purposes of this article it boils down to two reasons why the ship's pilots didn’t know that they were not where they thought they were.  

  1. The alarm that sounded was too weak to be heard.

  2. The error message was a cryptic acronym that they didn’t know the meaning of.

Why You Should Have Well Written Error Messages For Your Website Application

While developing software most of us aren’t going to have to worry about our lack of proper error handling causing a ship with 1500 souls on board to wreck and possibly end in tragedy. However, we still can contribute in general to human suffering and hurt the bottom line when we fail to write good error messages that can be noticed.

It is worth noting that while the principles below can be applied to actually state the error upon user input validation, we are mostly going to be discussing exception error handling going forward. Let's extract out two general principles from the above cruise ship example to help us implement better error handling.

Error messages need to be noticed

This should be pretty obvious but is an often overlooked requirement.  The utility of this principle should be self evident. If bad things are happening that hurts the user experience while users use your website or application, you want to know about it so you can fix the problem. This has become a lot easier with the rise of the many exception logging services out there.  At Left+Right we use the exception logging that is built into our project management application. By doing so, it streamlines the whole process of getting notified, creating a ticket and getting it fixed.  Even if your project management software doesn’t have this functionality there are plenty of standalone applications out there such as https://sentry.io/welcome/ and https://airbrake.io/.

Error messages must be clearly written with the proper context

Making sure that you are getting notified is just as important.  If you have ever been blessed with the white screen of death and some vague numeric error, you will know that the content of the error message(s) or lack thereof can and should be important. First, you need to think about who in the audience the message is for. In this case we are talking about exception handling so it is safe to assume that a reasonably technical person will be seeing it.  If the first person who sees it is not a technical person, such as project manager or user, most definitely at some point the person fixing the problem will be. 

We also need to take into account our desired outcome so the context of the problem is going to be important to us. The general template that we like to follow is: 1 - display a unique error message that succinctly summarizes or names the problem; 2 - any context that will help diagnose the problem; and 3 - a backtrace for your technical team to use for quicker resolution. 

We know that adding the proper error handling when having an application or website built can potentially be a pain for your tech team writing the code, but it often pays off many times over down the road when confronted with the challenge of diagnosing a problem. Error handling and implementing good error messages is something we practice as part of writing beautiful clean code. By doing so, it can turn 2 hours of staring into the metaphorical coding abyss, into 15 minutes of joyful tweaking. (Ok, maybe not joyful but at least it won’t be agony and you or others won’t want to throw their computer at the wall.) 

Shopping for a new digital agency?

Contact Us

Development

ExpressionEngine: Announcing Sherlock!

November 11, 2015 by Thomas Brewer

Strategy

Left+Right Builds Award Worthy Web Applications

June 08, 2017 by Monica Bohanon

Strategy

Website Content Strategy and Generation Z

June 12, 2017 by Thomas Brewer

x

Development

Application error messages, write good ones and make sure they are seen!

June 16, 2017 by Thomas Brewer

Strategy

Get Your YouTube Videos Seen With These 3 Search Optimization Tips

June 14, 2017 by Thomas Brewer

Strategy

Website Content Strategy and Generation Z

June 12, 2017 by Thomas Brewer

Strategy

The Importance of Having An SSL Certificate On Your Website

June 09, 2017 by Thomas Brewer

Strategy

Left+Right Builds Award Worthy Web Applications

June 08, 2017 by Monica Bohanon

Strategy

Google My Business for local SEO

June 06, 2017 by Thomas Brewer

Development

Do You Own Your Code?

March 01, 2017 by Thomas Brewer

News

Left+Right Hired by Fantasy Sports Startup

February 17, 2017 by Morgan Porter

News

Meet Our Newest Client: Asian & Pacific Islander American Scholarship Fund

December 07, 2016 by Morgan Porter

Strategy

Online Marketing Is A Lot Like Online Dating

September 08, 2016 by Terri Jones

News

Meet Our Newest Client: Rx Partnership

June 29, 2016 by Morgan Porter

Strategy

5 Reasons Your Content Should Live on Your Website

June 13, 2016 by Morgan Porter

News

Long Live RVA News

June 07, 2016 by Morgan Porter

Strategy

How Nonprofits Can Better Engage Millennials

June 02, 2016 by Thomas Brewer

Development

Why We Use Git

May 19, 2016 by Thomas Brewer

Development

ElasticSearch and Rails: Where did my records go?

February 09, 2016 by Thomas Brewer

Strategy

Why We Are Distributed

January 28, 2016 by Morgan Porter

Development

ExpressionEngine: Announcing Sherlock!

November 11, 2015 by Thomas Brewer

Development

ExpressionEngine: Houdini - making templates magical.

November 03, 2015 by Thomas Brewer

Development

Lazy Lion

October 29, 2015 by Thomas Brewer

Development

Rails ERD and Padrino

October 29, 2015 by Thomas Brewer

News

We're One of Richmond's Fastest Growing Companies

October 28, 2015

Strategy

The Importance of Responsive Design for Non-Profit Organizations

February 10, 2015

Contact Us