webtuitive

dream. code.

Wednesday, September 06, 2006

What's An Error?

Carrying on the theme of maintainability --

I see junior developers who have apparently never been involved in the ongoing operation of an application. While everyone has to start somewhere, the result is often code with exceptions that are caught and neither logged nor acted upon alongside exceptions thrown and logged when that serves no useful purpose.

Case in point: The logging for the current project sends an email when an "Error" is logged. Yesterday I started getting these when an invalid user name was entered. Excuse me? This is an expected behavior. People will make mistakes, unauthorized people will try to gain access, a test case will enter known invalid data to make sure it doesn't get in.

A proper response would be to prompt for input again, perhaps limit the number of attempts, provide a "forgot your user name?" link -- but certainly not log this as an "Error".

The only things that should log at that level are things thatrequire a developer to investigate.

About Me

Hassan has been involved in driving Web technology and user experience since 1994, developing the world's first dynamic Web site for Sun in 1995, and coining the phrase "Perl is the duct tape of the Internet", among other things.

Now he works primarily with Ruby on Rails while continuing to explore new languages and technologies.