Table of Contents

Enum ErrorSource

Namespace
Albatross.CommandLine
Assembly
Albatross.CommandLine.dll

Identifies the pipeline stage that produced an error condition so the error handler can explain it appropriately. Every error raised during command execution is tagged with one of these sources.

public enum ErrorSource

Fields

CommandHandler = 0

An exception escaped the command handler's execution.

CommandTaskCancellation = 3

The command handler was cancelled (an OperationCanceledException), typically from Ctrl+C. Symbol carries the command key.

OptionHandler = 1

An option handler (pre-action) reported an error — either it threw, or it recorded a validation failure. Symbol carries the option name.

OptionTaskCancellation = 4

An async option handler (pre-action) was cancelled (an OperationCanceledException); Symbol carries the option name.

Known limitation: this source is effectively unreachable via Ctrl+C today. System.CommandLine installs its process-termination handler — the piece that cancels the token and suppresses the OS default kill — only around the command action, never around pre-actions. So when the user presses Ctrl+C while an async option handler is running, the CancellationToken that handler received is never cancelled, and the process is hard-terminated by the default SIGINT/SIGTERM handling before this error can be produced (the handler simply vanishes mid-run). This source is therefore only reached when an option handler throws OperationCanceledException for its own reasons — e.g. an inner timeout token it created — not from process termination. Raising CommandHost.ProcessTerminationTimeout does not help: that only affects the command action.

ServiceRegistration = 2

The command handler could not be resolved or created from the service container.