Skip to main content

exit_code_for_error

Function exit_code_for_error 

Source
pub fn exit_code_for_error(err: &Error) -> i32
Expand description

Exit code semantics:

  • 0 — success
  • 1 — generic failure (I/O, detection, child-process non-zero)
  • 2 — resolver could not satisfy intent (typed resolver error)

main and bin/run.rs use this to map an anyhow::Error to the right code: anything that downcasts to the internal resolver-error type is 2, everything else is 1. The resolver-error type itself is crate-private; only the exit-code projection is part of the library’s public surface.