DataSource.NET  6.2.20.310828
Caplin.Exceptions.IExceptionHandler Interface Reference

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...

Inheritance diagram for Caplin.Exceptions.IExceptionHandler:
Caplin.Logging.ConsoleLogger

Public Member Functions

void HandleException (Exception ex)
 Handles an exception raised by the Caplin library. More...
 

Detailed Description

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).

Important

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.

Warning
The IExceptionHandler methods are not called on a dedicated worker thread. They are called directly from a thread running within the Caplin library.

Member Function Documentation

void Caplin.Exceptions.IExceptionHandler.HandleException ( Exception  ex)

Handles an exception raised by the Caplin library.

Parameters
exThe exception raised by the library.

Implemented in Caplin.Logging.ConsoleLogger.


Generated on Wed Jan 24 2018 12:22:40 for DataSource.NET