Interface ICommandExecutionExceptionHandler
This interface can be implemented to catch and handle errors that occur in execution
Namespace: AzureFromTheTrenches.Commanding.Abstractions
Assembly: AzureFromTheTrenches.Commanding.Abstractions.dll
Syntax
public interface ICommandExecutionExceptionHandler
Methods
| Improve this Doc View SourceHandleException<TResult>(Exception, Object, Int32, ICommand<TResult>, ICommandDispatchContext)
Handles an exception in command execution, if the handler does not rethrow the exception it can return true to continue to run registered handlers or false to stop running registered handlers
Declaration
Task<bool> HandleException<TResult>(Exception ex, object handler, int handlerExecutionIndex, ICommand<TResult> command, ICommandDispatchContext dispatchContext)
Parameters
Type | Name | Description |
---|---|---|
Exception | ex | Exception raised |
System.Object | handler | The handler that caused the exception |
System.Int32 | handlerExecutionIndex | The index in theexecution sequence of the handler |
ICommand<TResult> | command | The command being executed |
ICommandDispatchContext | dispatchContext | The current dispatch status |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True to continue, false to stop |
Type Parameters
Name | Description |
---|---|
TResult | Type of the command result |