Skip to content

Code Review #5 – splurge on reporting configuration errors

Configuration problems when deploying a new build are high on the “high anxiety” list. The pressure is high to hurry up and get the build deployed. Often times, the deploy happens late at night when the deployer really just wants to go to bed.

The number one way a developer can help out in this situation is very good error messages. If an exception occurs as a result of a misconfiguration: be verbose. Be overly verbose. The sanity you save may be your own.

This error message does not cut it:

Caused by: Couldn’t initialize working directory.
at com.amplafi.core.iomanagement.FtpManagerImpl.initializeWorkingDirectory(
at com.amplafi.core.iomanagement.FtpManagerImpl.initializeService(
… 16 more
Caused by: Couldn’t create directory: ftp-working
at com.amplafi.core.iomanagement.FtpManagerImpl.initializeDirectory(
at com.amplafi.core.iomanagement.FtpManagerImpl.initializeWorkingDirectory(

The error message should have at the minimum contained the following pieces of information:

  • The directory name as supplied in the configuration
  • The full absolute path to that directory (not the same thing as the configuration name if the name is a relative, not absolute path)
  • The reason for the problem (was the parent directory not writable, something already there, disk full, etc.)
  • A suggestion on how to correct the problem

Posted in code review, technical.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

or, reply to this post via trackback.