Thursday, June 17, 2010

Handle exception

If you are using try/catch block for handling exception then make sure the catch block handles the exception. It can be showing a message to the user and/or logging the exception details to a log file along with realsing the resources and transcation rollbacks.

Rule: Handle the exception in the catch block.

Rule: Rollback transaction in the catch block if applicable.

No comments: