Class TigerCliCommandException
- Namespace
- ItTiger.TigerCli.Exceptions
- Assembly
- ItTiger.TigerCli.dll
Classified command failure for handlers — especially reusable command libraries — that want to
express what kind of failure occurred using TigerCli concepts without owning the application's
numeric exit-code scheme. Throwing this from a command handler reports
Message as a framework error and resolves the process exit code through
the app's exit-code policy for ExitKind, instead of the
UnhandledException mapping every other escaping exception gets.
public class TigerCliCommandException : Exception, ISerializable
- Inheritance
-
TigerCliCommandException
- Implements
- Inherited Members
Remarks
The application keeps full ownership of numeric codes: it maps the thrown kind (or its category)
with the existing
UseExitCodes / ExitKind / ExitCategory / ExitRange
builder configuration. An optional ErrorId carries a stable, library-defined
identifier (for example "TQ0007") that is appended to the reported message so scripts,
logs, and tests can match the failure without parsing prose.Constructors
TigerCliCommandException(string, TigerCliExitKind, string?, Exception?)
Creates a classified command failure.
exitKind defaults to
GenericFail and must be an error kind: success kinds
(Success, HelpShown) and
Cancelled are rejected — express cancellation with
OperationCanceledException instead.public TigerCliCommandException(string message, TigerCliExitKind exitKind = TigerCliExitKind.GenericFail, string? errorId = null, Exception? innerException = null)
Parameters
messagestring- The user-facing failure reason; must not be null, empty, or whitespace.
exitKindTigerCliExitKind- The framework classification; must be a defined error kind.
errorIdstring- Optional stable, library-defined failure identifier.
innerExceptionException- Optional underlying exception that caused the failure.
Exceptions
- ArgumentException
messageis null, empty, or whitespace.- ArgumentOutOfRangeException
exitKindis not a defined TigerCliExitKind, is a success kind, or is Cancelled.
Properties
ErrorId
Optional stable, library-defined failure identifier (for example
"TQ0007").
When present it is appended to the reported error message.public string? ErrorId { get; }
Property Value
ExitKind
The framework classification for this failure. Resolved to the process exit code through the
app's exit-code policy (kind → range → category → outcome baseline).
public TigerCliExitKind ExitKind { get; }