ASP.NET Community Software: Exception Handling Framework in Communifire

by Tim Eisenhauer on April 15, 2009 · 2 comments

in Social Media

ASP.NET Community Software Communifires’, Flexible plug-n-play Exception Handling Framework

In today’s fast paced software development models, even the most stable applications will experience an occasional situation in which an error pops up.  Even after extensive testing and quality assurance, it’s possible to still experience errors from time to time.  Sometimes errors will occur due to invalid user input, misuse of a certain feature, or sometimes there may just be a bug in the code.  We’ve all come to live with the possibility of an error within an application.  Until a breakthrough is made in artificial intelligence, software applications continue to require that the users interact with them in a fairly well defined manner.

What’s important, is how an application responds, handles, and recovers from the error.

When an error does occur, the software application must clearly communicate to the user:

  • why the data is not valid
  • make it easy for the user to recover from the error, and
  • allow the technical team behind the error to easily fix the problem

Communifire, our ASP.NET social networking platform, is no exception.  With such a large code base containing hundreds of thousands of lines of code, there is still a possibility for an error to occur here and there.  And when an error does occur, we stand behind our product and promptly fix the bug in the code.  With this in mind, and to combat the “blue or yellow screen of death,” we have built in a comprehensive exception handling and logging framework.  Every section of code within Communifire, from the database layer, to business later, to the UI layer, contains error handling.

All exceptions are handled and logged within in code, along with all the necessary technical information to pinpoint, analyze, and fix the error.  The system is smart — after making sure that the exception has been logged, the layer in the code where the error happened will re-throw a user friendly exception message to the user interface, informing the user of the error. This friendly exception message is necessary because the end users do not want to see the technical details of the exception.  All errors are logged into a database and accessible from within the administration section of the social networking platform, allowing our technical team to download the error details, analyze them, and promptly fix them.

A few salient points to ensure your satisfaction when dealing with errors:

  • Communifire logs all exceptions and re-throws “user friendly” messages.
  • The complete stack trace is recorded to insure that programmers can have access to all the details related to the exception that was thrown.
  • The exception and logging system is based on the “Factory Design pattern” to easily allow developers to extend the framework and add custom logging classes. This also allows you to log exceptions to the database, in the event log, to a custom text or XML file or all of the above.
  • All user-friendly exception messages are stored in an XML resource file. You can easily alter the friendly error messages without the need to re-compile the code.
  • Errors are usually simple to fix, due to the organized and well documented source code.

You have just read an overview of the features of the error handling and exception logging functionality in the Communifire Social Networking Platform. If you’re interested in checking out a live social network running on Communifire, you can check out CodeAsp.Net – an ASP.NET Community.

And to learn more about Communifire, click here to read about the Social Networking Platform in ASP.NET.

{ 2 comments… read them below or add one }

Chris June 3, 2009 at 8:42 pm

Is this like ELMAH?

Vivek July 1, 2009 at 12:37 pm

ELMAH has some extra features, but ours is quite easy to implement and understand. ELMAH has grown over the years but is another good option. The reason we went for our own framework was the need for simplicity and better adaption to our existing community framework.

Leave a Comment

Previous post: Social Networking Platform – Blog Features

Next post: Where Do Your Customer’s Live Online?