autowisp.error_cli module

Class Inheritance Diagram

Inheritance diagram of AutoWISPError, Component, Error

CLI-side error reporting: persist, render to stderr, set exit code.

The top-level CLI handlers (run_pipeline and, via cli_entry_point(), each standalone wisp-* step entry) funnel an escaping AutoWISPError through report_error(), which records it as an Error row plus sidecar and renders the stored record to stderr.

autowisp.error_cli._wants_traceback()[source]

Whether the invocation asked for the full developer traceback.

Looks for --traceback on the command line (kept distinct from the steps’ -v logging-verbosity flag to avoid clashing).

autowisp.error_cli.cli_entry_point(*, component)[source]

Decorate a standalone wisp-* main() as a CLI error boundary.

Wraps the callable so that any escaping exception is converted to the right AutoWISPError (via capture_errors()), stamped with the ambient pipeline-run context if it lacks one, reported with report_error(), and turned into a non-zero SystemExit.

Parameters:

component (Component) – The component the entry point belongs to.

Returns:

The decorator.

Return type:

Callable

autowisp.error_cli.exit_code_for(component)[source]

Map an error’s component to a process exit code.

Distinct codes let shell scripts tell a step failure from a pipeline (orchestration/config) failure.

Parameters:

component (Component) – The failing component.

Returns:

A non-zero exit code.

Return type:

int

autowisp.error_cli.report_error(exc, *, developer=False, stream=None)[source]

Persist exc and render the stored record to stream.

The default view is the one-line error_summary(); developer switches to the full format_detail_text(). Either way a pointer line names the Error id and the crash-report command. If persistence fails (e.g. no project database), a minimal line is printed instead so the user still sees something. Never raises.

Parameters:
  • exc (AutoWISPError) – The error to report.

  • developer (bool) – Render the full technical detail.

  • stream – Output stream; defaults to sys.stderr.

Returns:

The exit code for exc (see exit_code_for()).

Return type:

int