Skip to main content

Module channel

Module channel 

Source
Expand description

Where JSON reports go, and the envelope of a command that failed before it could produce its report.

An application binary writes its report to stdout, unless the REPORT_PATH_ENV variable names a file. The siderite tool sets it when it runs the application through cargo run, and sends the child’s stdout to stderr, so whatever the application factory prints can never corrupt the JSON on stdout.

Constants§

FAILED_CODE
Diagnostic code of a command that failed without a report (exit 1).
NO_REPORT_CODE
Diagnostic code of an application that exited without writing its report (build failure, crash, or a siderite-cli without --json).
REPORT_PATH_ENV
Environment variable naming the file an application binary writes its JSON report to instead of stdout.
USAGE_CODE
Diagnostic code of a usage error (exit 2).

Functions§

emit
Write a rendered report to path (the value of REPORT_PATH_ENV) or, when it is None, to stdout.
emit_json
Render report as JSON and emit it.
error_envelope
The failure envelope of a CliError.
failure
The envelope of command when it failed before producing a report: ok is false, data is null and one error diagnostic explains why.