Table of Contents

Class ExceptionHandlerFailedException

Namespace
Ploch.CommandLine.Spectre.Commands
Assembly
Ploch.CommandLine.Spectre.dll

Thrown by AppCommand<TSettings> and AsyncAppCommand<TSettings> when the registered IExceptionHandler throws while handling an exception.

public sealed class ExceptionHandlerFailedException : Exception, ISerializable
Inheritance
ExceptionHandlerFailedException
Implements
Inherited Members

Remarks

The handler ConfigureCommandApp(Action<IConfigurator>) installs reports the handler's exception once and exits with Error, without asking the same handler to handle its own exception. An application that switched Spectre's handling off with PropagateExceptions() sees this exception instead; InnerException is what the handler threw and Original is what it was asked to handle.

Constructors

ExceptionHandlerFailedException()

Initializes a new instance of the ExceptionHandlerFailedException class.

ExceptionHandlerFailedException(Exception, Exception)

Initializes a new instance of the ExceptionHandlerFailedException class for a handler that threw handlerException while handling original.

ExceptionHandlerFailedException(string)

Initializes a new instance of the ExceptionHandlerFailedException class with a message.

ExceptionHandlerFailedException(string, Exception?)

Initializes a new instance of the ExceptionHandlerFailedException class with a message and the exception that caused it.

Properties

Original

Gets the exception the handler was asked to handle, or null when the instance was not created for a failed handler call.