Handle Exceptions
Create your own Exception Handler
- Create a Public Instance Class
- Implement the interface
ITickerExceptionHandler
csharp
public class TickerExceptionHandler : ITickerExceptionHandler
{
public async Task HandleExceptionAsync(Exception exception, Guid tickerId, TickerType tickerType)
{
// your logic...
}
public async Task HandleCanceledExceptionAsync(Exception exception, Guid tickerId, TickerType tickerType)
{
// your logic...
}
}
Register your Exception Handler
- After creating and implementing your
ExceptionHandler
class you should add it atTickerQ
Config.
csharp
....
services.AddTicker(opt =>
{
opt.SetExceptionHandler<TickerExceptionHandler>();
});