ReplExecutionOutcomeKind
Classifies how a top-level run ended, independently of the exit code eventually returned. Values are explicit and append-only so consumers can persist or switch on them safely.
- Kind:
Enum - Namespace: Repl
- Assembly:
Repl.Core - Source: src/Repl.Core/ReplExecutionOutcomeKind.cs
Signature
Section titled “Signature”public enum ReplExecutionOutcomeKindFields
Section titled “Fields”BindingError
Section titled “BindingError”Handler arguments could not be bound: a token failed to convert or was missing, or a value the
binder resolves itself (context value, [FromServices] dependency, typed global options
service) was unavailable.
BindingError = 3Returns
Section titled “Returns”Cancelled
Section titled “Cancelled”The caller’s own CancellationToken stopped the run — already cancelled at the call, during the command, or while hosted services were starting.
One-shot and interactive runs draw the line differently, deliberately. In a one-shot run only the
caller’s token yields this kind: a handler that raises OperationCanceledException on
its own account is a HandlerException, so a real failure cannot pass for an operator
abort. An interactive session instead treats a command-scoped
OperationCanceledException as an abort — Ctrl+C and a self-cancelling handler alike:
it prints Cancelled. and decorates the command-end mark with this kind’s code rather than
rendering the exception.
Two interactive cases are not this kind at all, and neither carries a code: an abandoned prompt (empty line, Escape, end of input), and a cancellation of the session’s own token — host shutdown — which propagates out of the loop after closing the cycle with an aborted mark.
Cancelled = 7Returns
Section titled “Returns”CompletedWithFailures
Section titled “CompletedWithFailures”The handler ran to completion and returned an ICompletedWithFailuresResult: the command did its job, and what it reports contains failures (tests that failed, records that were rejected). Distinct from HandlerError, where the command itself failed.
CompletedWithFailures = 10Returns
Section titled “Returns”FrameworkError
Section titled “FrameworkError”The framework itself failed: an incompatible adapter contract, an unsupported hosting capability, or a hosted service that could not start or stop. The outcome carries the exception when one caused it.
FrameworkError = 9Returns
Section titled “Returns”HandlerError
Section titled “HandlerError”The handler ran and returned a failure result (error, validation, not_found, …).
HandlerError = 4Returns
Section titled “Returns”HandlerException
Section titled “HandlerException”The handler, a middleware, or user code running after binding (validators, banners, output transformers) threw an exception that the framework reported.
HandlerException = 6Returns
Section titled “Returns”HandlerExitCode
Section titled “HandlerExitCode”The handler returned an IExitResult; its exit code is used verbatim.
HandlerExitCode = 5Returns
Section titled “Returns”The invocation rendered help instead of running a command: help request, bare invocation, or scoped-context help.
Help = 1Returns
Section titled “Returns”Interrupted
Section titled “Interrupted”The run was interrupted by a process signal (SIGINT, Ctrl+Break, SIGTERM) that the framework
claimed, which standalone runs opt into through ReplRunOptions.ProcessSignalHandling. The
core pipeline never produces it on its own: an interruption is decided by the signal owner around
the run, and only a clean or cancelled run is reclassified — one that already produced a refusal
or a failure keeps reporting it.
Interrupted = 8Returns
Section titled “Returns”Success
Section titled “Success”The handler completed and produced a success-like result (or no result); also an ambient command
(exit, ..) that did its job, and a clean interactive session exit.
Success = 0Returns
Section titled “Returns”UsageError
Section titled “UsageError”The framework refused the invocation before the handler ran: unknown command, ambiguous prefix, invalid option, unknown output format, or context validation failure.
UsageError = 2