Expand description
NodeError — every way a node can fail, named.
One error type for the whole surface, because a node author writes
-> Result<(), NodeError> on main exactly once and never wants to think
about it again (blueprint §9.1). The variants are grouped by who is at
fault, which is what a caller actually branches on:
| Group | Variants | Typical response |
|---|---|---|
| Environment | NodeError::Config, NodeError::MissingEnv, NodeError::BadEnv | The node was launched wrong; exit non-zero |
| Connection | NodeError::Connect, NodeError::Transport, NodeError::Handshake, NodeError::DaemonGone | The daemon is unreachable; exit and let supervision restart |
| Lifecycle | NodeError::Stopped, NodeError::Orphaned | Wind down cleanly; these are expected endings |
| Usage | NodeError::UnknownOutput, NodeError::UnknownInput, NodeError::TypeMismatch, NodeError::BlockingInAsync | A bug in the node; fix the call |
| Payload | NodeError::Data, NodeError::PayloadTooLarge, NodeError::Shm | Bad or oversized data |
§Examples
use astrs_node_api::NodeError;
let error = NodeError::Stopped;
assert!(error.is_shutdown());
assert!(!error.is_retryable());
assert_eq!(error.exit_code(), 0, "a requested stop is a clean exit");Enums§
- Node
Error - Everything that can go wrong in a node.
Type Aliases§
- Result
- The node API’s result alias.