#[non_exhaustive]pub enum OpError {
InvalidOutputId {
id: String,
source: IdError,
},
Encode(DataError),
Ipc(IpcError),
DuplicateOperator {
name: String,
},
UnknownOperator {
name: String,
},
Failed {
message: String,
},
}Expand description
A failure inside the operator host’s boundary (blueprint §9.3).
#[non_exhaustive]: the append-only evolution rule (blueprint §3.4)
applies to this crate’s error type too.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidOutputId
crate::OpOutput::send_bytes, crate::OpOutput::send_batch or
crate::OpOutput::send was given a name that is not a valid
astrs_wire::DataId.
Fields
source: IdErrorWhy astrs_wire::DataId::new rejected it.
Encode(DataError)
crate::OpOutput::send or crate::OpOutput::send_batch failed to
build the outgoing astrs_data::RecordBatch.
Ipc(IpcError)
crate::OpOutput::send or crate::OpOutput::send_batch failed to
encode the outgoing batch as an Arrow IPC payload.
DuplicateOperator
crate::OperatorRegistry::register was given a name already
registered.
UnknownOperator
crate::OperatorRegistry::build was asked for a name with no
registered constructor.
Failed
An operator reported its own domain failure.
The escape hatch for operator authors whose failure does not fit any
of the structured variants above — still typed (a String, not a
panic), and still routed through the same NodeFailed reporting path
(blueprint §9.3: “panics are caught, reported as NodeFailed”).
Implementations§
Source§impl OpError
impl OpError
Sourcepub fn invalid_output_id(id: impl Into<String>, source: IdError) -> Self
pub fn invalid_output_id(id: impl Into<String>, source: IdError) -> Self
Builds an OpError::InvalidOutputId without repeating the id at
every call site.
Sourcepub fn failed(message: impl Into<String>) -> Self
pub fn failed(message: impl Into<String>) -> Self
Builds an OpError::Failed from any displayable message.
use astrs_operator_api::OpError;
let err = OpError::failed("model did not load");
assert_eq!(err.to_string(), "operator failed: model did not load");Trait Implementations§
Source§impl Error for OpError
impl Error for OpError
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()