Skip to main content

Module error

Module error 

Source
Expand description

Error types and exit-code mapping for docsrs-cli.

§Model (Rules Rust — error handling)

  • Recoverable failures are AppError / AppResult (I/O, network, parse, validation).
  • ErrorKind is the stable discriminant for exit codes and JSON error.kind.
  • std::error::Error::source preserves the lower-level cause when present.
  • Display messages are technical English: lowercase, no trailing period, no secrets.
  • Panic is reserved for static invariants (hardcoded regex / CSS selectors).
  • Library API: typed thiserror enum, not anyhow / Box<dyn Error> as the public E.

See docs/decisions/0002-error-model.md.

§Errors

KindExitRetryable
usage64no
invalid_input65no
not_found66no
rate_limited / unavailable69yes
network74yes
timeout124yes
parse65no
config78no
internal70no
interrupted (SIGINT)130no
terminated (SIGTERM)143no
broken_pipe (stdout EPIPE)141no

Enums§

AppError
Application error with structured kind for agents.
ErrorKind
Canonical error kinds exposed in JSON envelopes.

Type Aliases§

AppResult
Result alias for library operations.