Interface ICommandErrorHandler
- Namespace
- Albatross.CommandLine
- Assembly
- Albatross.CommandLine.dll
public interface ICommandErrorHandler
Methods
Handle(params IEnumerable<Error>)
Called with one or more error conditions collected during command execution, from any ErrorSource — the command handler, option handlers, service resolution, or cancellation. Because several option handlers can fail in a single invocation, the errors arrive as a set. The handler's only job is to notify the user of the errors (e.g. print to stderr). Return a non-null exit code to override the default; return null to fall through to the default error exit code.
int? Handle(params IEnumerable<Error> errors)
Parameters
errorsIEnumerable<Error>
Returns
- int?
Remarks
Logging is not necessary here: each error is already logged at the catch site before this handler is invoked. The handler's job is only to notify the user of the error (e.g. print to stderr).