pub fn emit_error(
message: &str,
exit_code: u8,
output: OutputFormat,
) -> ExitCodeExpand description
Emit an error as structured JSON on stdout when --format json is active,
then return the given exit code. For non-JSON formats, emit to stderr as usual.