DataSource.NET
IExceptionHandler Interface
NamespacesCaplin.ExceptionsIExceptionHandler
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.
Declaration Syntax
C#Visual BasicVisual C++
public interface IExceptionHandler
Public Interface IExceptionHandler
public interface class IExceptionHandler
Members
All MembersMethods



IconMemberDescription
HandleException(Exception)
Handles an exception raised by the Caplin library.

Remarks

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

Thread Safety

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

Assembly: DataSource.NET (Module: DataSource.NET) Version: 6.0.12.814 (6.0.12.0814)