The general concept around exception handling is to not let the system handle exceptions, but instead to do something about them.
Conventional programming languages such as Java, C++ or C#, exception handling is best practice, and not implementing it would lead to application crashes, blue screens (in the case of the OS) or data loss. Exception handling exists to provide the programmer a way to have a grip on the execution runtime and do something about it.
For example: Let’s say that we have built a Windows Application that requires the user to fill out a form. The user usually goes to a screen, fills out a very long and detailed form, and when clicks Submit, the connection to the Database fails. Without exception handling the application crashes, and the whole form is lost, along the data that the user entered tirelessly. This way we are able to still hold this form, for example we can prompt the user to Save the form on Disk, or hold it in a queue until the Database Server becomes available, send a notification to IT to look into this problem, or whatever merits the situation.
Here are a few articles about Exception Handling Best Practices from Microsoft’s MSDN:
- A well-designed app handles exceptions and errors to prevent app crashes. This article describes best practices for handling and creating exceptions.
- Exception Handling Application Block is the same concept we always implement and propose in our solutions. It is a standardized and centralized way to handle and manage Exceptions in BizTalk.
- An Exception Management Framework is available for some of the challenges mentioned in this document. Although we don’t use all of it (because we feel that it is not complete at this time), the general idea is described in here.
- Failed Message Routing
- BizTalk Orchestration Exception handling
For more information about BizTalk Integration check our BizTalk as ESB video.