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). ErrorKindis the stable discriminant for exit codes and JSONerror.kind.std::error::Error::sourcepreserves 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
thiserrorenum, notanyhow/Box<dyn Error>as the publicE.
See docs/decisions/0002-error-model.md.
§Errors
| Kind | Exit | Retryable |
|---|---|---|
| usage | 64 | no |
| invalid_input | 65 | no |
| not_found | 66 | no |
| rate_limited / unavailable | 69 | yes |
| network | 74 | yes |
| timeout | 124 | yes |
| parse | 65 | no |
| config | 78 | no |
| internal | 70 | no |
| interrupted (SIGINT) | 130 | no |
| terminated (SIGTERM) | 143 | no |
| broken_pipe (stdout EPIPE) | 141 | no |
Enums§
- AppError
- Application error with structured kind for agents.
- Error
Kind - Canonical error kinds exposed in JSON envelopes.
Type Aliases§
- AppResult
- Result alias for library operations.