An Exception Handling Strategy Template
Jakob Jenkov |
Now that you have seen the requirements for an exception handling strategy, and seen what elements it consists of, I will try to put together an exception handling strategy template, that you can use for your own applications.
Remember, this template may not suit your application perfectly, so make the changes you need to make to it.
The strategy template consists of the following elements:
- An AppException and ErrorInfo template.
- An explanation of how to throw the AppException.
- An explanation of how to propagate the AppException.
- An explanation of how to extract information from the ErrorInfo list inside the AppException.
- An explanation of how to catch and handle the AppException.
Each of these parts are described in the following texts.
Tweet | |
Jakob Jenkov |