DataSource.NET
8.0.3.290770-7760911e
|
Definition of the interface that receives exceptions generated by the Caplin library on its own threads. You should implement this interface to ensure that your application can handle such exceptions. More...
Public Member Functions | |
void | HandleException (Exception ex) |
Handles an exception raised by the Caplin library. More... | |
Definition of the interface that receives exceptions generated by the Caplin library on its own threads. You should implement this interface to ensure that your application can handle such exceptions.
It is recommended that you implement the IExceptionHandler interface so that your application can handle exceptions generated by the library . Such an exception generally indicates that the internal state of the the library can no longer be relied upon as being correct, unless the exception inherits from Caplin.Exceptions.RecoverableException (see below).
In most cases the library will only propagate an exception to the IExceptionHandler if it indicates an unrecoverable error, allowing you to shut down and restart the application in an appropriate manner. However in some cases an exception will be propagated to the IExceptionHandler for informational purposes, in which case an application restart is not required. It is recommended that your implementation of IExceptionHandler should check if the exception passed to it inherits from Caplin.Exceptions.RecoverableException, and if so you may wish to take a different course of action.
If the exception passed to your exception handler is not recoverable then your exception handler should shut the application down gracefully, since the only way to recover from the exception is to restart the application. There is no need to log the exception in the handler because the library logs it through the Caplin.Logging.ILogger before passing it to the IExceptionHandler.
The application must register the IExceptionHandler with the Caplin Library by setting the ExceptionHandler property on the main library object.
void Caplin.Exceptions.IExceptionHandler.HandleException | ( | Exception | ex | ) |
Handles an exception raised by the Caplin library.
ex | The exception raised by the library. |
Implemented in Caplin.Logging.ConsoleLogger.