Bad Developer, No Twinkie Part 1: Unclear error messages

In the spirit of Ernest Adam’s “Bad Game Designer, No Twinkie!” series, I’m tempted to write a series of blog posts about bad things I’ve seen in general programming.

The first one up to the bat: unclear error messages.

This one bit my team this morning.  We have a nightly job that runs, and tries to associate data between two different systems.  Each time this cron job runs, it sends me an email and tells me if any part of the data isn’t successfully matched between systems.  This morning we finally had the time to look into some potentially bad data, and came across a particular error message.

Let’s say our data has 5 parts that all need to be in place for the import to work.  In our case, it wasn’t that part A was bad, or that part B was bad, it was actually part C that was bad.  Unfortunately our error message looked something like:

Bad data in Part B.

A bit of a red herring, no?  It wasn’t an outright incorrect error message, but it led us down a debugging path that we didn’t need to go down.  We ended up spending longer debugging the process because the message being generated wasn’t the real cause of the fault.

The lesson: Make sure your error messages actually reflect the cause of the problem.  Include as much information as possible as to what actually failed.  It’ll make your life (or the next developer’s life) easier in the long run.

Don’t do this:

Awesome.png

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s