#[non_exhaustive]pub enum NodeError {
Show 27 variants
Config(NodeConfigError),
MissingEnv {
name: &'static str,
},
BadEnv {
name: &'static str,
value: String,
reason: String,
},
Connect {
attempts: Vec<(String, String)>,
},
Handshake(String),
Registration(String),
DaemonGone,
Transport(TransportError),
Wire(WireError),
Data(DataError),
Ipc(IpcError),
TypeUrn(TypeUrnError),
Shm(ShmError),
Id(IdError),
Scheduler(SchedulerError),
UnknownOutput {
output: DataId,
},
UnknownInput {
input: DataId,
},
TypeMismatch {
port: DataId,
declared: String,
requested: String,
},
PayloadTooLarge {
len: usize,
max: usize,
},
BlockingInAsync {
method: &'static str,
alternative: &'static str,
},
Stopped,
Orphaned {
parent_pid: u32,
},
Timeout {
operation: &'static str,
millis: u64,
},
Backpressure {
depth: usize,
},
Runtime(String),
Pattern(String),
Testing(String),
}Expand description
Everything that can go wrong in a node.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Config(NodeConfigError)
The ASTRS_NODE_CONFIG blob was missing, corrupt or unusable (§24.2).
MissingEnv
A required environment variable was unset.
BadEnv
An environment variable held something this build cannot parse.
Fields
Connect
No daemon endpoint could be dialled.
Carries every attempt, because “connection refused” on the Unix socket and “no route to host” on the TCP fallback are two different diagnoses and a node that reports only the last one sends its operator looking in the wrong place.
Handshake(String)
The daemon refused the greeting, or the greeting could not be completed (§7.2).
Registration(String)
The daemon refused the registration (§7.3 Register).
DaemonGone
The connection to the daemon ended.
Transport(TransportError)
A transport-level failure.
Wire(WireError)
A protocol-level failure.
Data(DataError)
A columnar payload could not be built, encoded or decoded.
Ipc(IpcError)
An Arrow IPC stream could not be encoded or decoded (§6.1).
TypeUrn(TypeUrnError)
A type URN was malformed, unknown, or did not match a port’s declared layout.
Shm(ShmError)
A shared-memory operation failed (§6.2).
Id(IdError)
An identifier failed its grammar.
Scheduler(SchedulerError)
An input queue could not be created or registered (§11.2).
UnknownOutput
The node has no such output.
UnknownInput
The node has no such input.
TypeMismatch
A typed handle was opened on a port whose declared URN says something
else (§9.2, ASTRS_TYPE_CHECK=error).
Fields
PayloadTooLarge
A payload exceeded the §6.1 cap or the negotiated frame limit.
BlockingInAsync
A blocking call was made from a single-threaded async context, where blocking would deadlock the only worker.
The fix is always the same: call the _async twin of whatever was
called, or run the node’s loop on a multi-thread runtime.
Fields
Stopped
The node was asked to stop (§7.3 Stop).
Returned by operations attempted after the event stream fused. It is
an expected ending, not a failure — see NodeError::is_shutdown.
Orphaned
The supervising process disappeared, so this node is an orphan (§4.2).
Timeout
An operation ran out of time.
Backpressure
The request channel to the daemon is full and the caller asked not to wait.
The channel is bounded on purpose: an unbounded one turns a wedged daemon into unbounded memory growth in every node at once.
Runtime(String)
A tokio runtime could not be built for a node created outside one.
Pattern(String)
A pattern helper was used out of order (§9.4).
Testing(String)
The testing harness could not be driven as asked.
Implementations§
Source§impl NodeError
impl NodeError
Sourcepub const fn is_shutdown(&self) -> bool
pub const fn is_shutdown(&self) -> bool
Whether this error means “shut down cleanly” rather than “something broke”.
§Examples
use astrs_node_api::NodeError;
assert!(NodeError::Stopped.is_shutdown());
assert!(NodeError::Orphaned { parent_pid: 1 }.is_shutdown());
assert!(!NodeError::DaemonGone.is_shutdown());Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Whether retrying the same operation could plausibly succeed.
§Examples
use astrs_node_api::NodeError;
assert!(NodeError::Backpressure { depth: 64 }.is_retryable());
assert!(!NodeError::UnknownInput { input: "x".parse()? }.is_retryable());Sourcepub const fn is_usage_error(&self) -> bool
pub const fn is_usage_error(&self) -> bool
Whether this error is the node’s own fault — a call that can never succeed as written.
Sourcepub const fn exit_code(&self) -> i32
pub const fn exit_code(&self) -> i32
The process exit status a main should use for this error.
A clean shutdown is 0; everything else is 1, which is what the
daemon’s restart policy (§12) reads as a failure.
§Examples
use astrs_node_api::NodeError;
assert_eq!(NodeError::Stopped.exit_code(), 0);
assert_eq!(NodeError::DaemonGone.exit_code(), 1);Sourcepub const fn kind_name(&self) -> &'static str
pub const fn kind_name(&self) -> &'static str
A short, stable slug for metrics labels and structured logs.
Sourcepub const fn stop_cause(&self) -> Option<StopCause>
pub const fn stop_cause(&self) -> Option<StopCause>
The stop cause a node should report for this error, when it reports one.
Trait Implementations§
Source§impl Error for NodeError
impl Error for NodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<NodeConfigError> for NodeError
impl From<NodeConfigError> for NodeError
Source§fn from(error: NodeConfigError) -> Self
fn from(error: NodeConfigError) -> Self
Source§impl From<NodeError> for ArrowSendError
Available on crate feature arrow-interop only.
impl From<NodeError> for ArrowSendError
arrow-interop only.