Skip to content

xnano.cli.errors

xnano.cli.errors

xnano.cli.errors


Errors raised while parsing or running commands.

Classes:

CliError dataclass

CliError(
    message: str,
    command: "Command | None" = None,
    exit_code: int = 2,
)

Bases: Exception

User-facing CLI failure.

Attributes:

  • message (str) –

    Error text shown to the user.

  • command ('Command | None') –

    Command that failed, when known.

  • exit_code (int) –

    Process exit status used by run().

message instance-attribute

message: str

Error text shown to the user.

command class-attribute instance-attribute

command: 'Command | None' = None

Command that failed.

exit_code class-attribute instance-attribute

exit_code: int = 2

Process exit status.

HelpRequested dataclass

HelpRequested(command: 'Command')

Bases: Exception

Internal control flow when help was requested.

Attributes:

  • command ('Command') –

    Command whose help was requested.

command instance-attribute

command: 'Command'

Command whose help was requested.