/// <summary> /// Override in a derived class for the handler logic /// </summary> /// <param name="request">Failed request</param> /// <param name="exception">The thrown exception</param> /// <param name="state">The current state of handling the exception</param> protected abstract void Handle(TRequest request, TException exception, RequestExceptionHandlerState <TResponse> state);
/// <summary> /// Override in a derived class for the handler logic /// </summary> /// <param name="request">Failed request</param> /// <param name="exception">The thrown exception</param> /// <param name="state">The current state of handling the exception</param> /// <param name="cancellationToken">Cancellation token</param> protected abstract Task Handle(TRequest request, Exception exception, RequestExceptionHandlerState <TResponse> state, CancellationToken cancellationToken);
Task IRequestExceptionHandler <TRequest, TResponse, TException> .Handle(TRequest request, TException exception, RequestExceptionHandlerState <TResponse> state, CancellationToken cancellationToken) { Handle(request, exception, state); return(Task.CompletedTask); }
async Task IRequestExceptionHandler <TRequest, TResponse, Exception> .Handle(TRequest request, Exception exception, RequestExceptionHandlerState <TResponse> state, CancellationToken cancellationToken) { await Handle(request, exception, state, cancellationToken).ConfigureAwait(false); }