Skip to main content

Module error

Module error 

Source
Expand description

The Error type returned by all fallible operations in this crate.

use adam_rs::{CellId, Error, ErrorSite, Sheet};
let mut sheet = Sheet::new();
let value = sheet.add_cell(1_i32);
assert!(matches!(sheet.read::<i32>(CellId::default()), Err(Error::InvalidId)));
let source = sheet.add_source(0_i32);
let error = sheet.add_relationship(vec![
    adam_rs::Method::from_fn_1_1(value, source, |v: &i32| Ok(*v))
]).unwrap_err();
assert!(matches!(error, Error::InvalidCellKind { .. }));
assert!(error.sites().contains(&ErrorSite::Cell(source)));

Enums§

Error
Errors returned by Sheet operations and propagation.
ErrorSite
Identifies a single sheet component an error implicates, for translating back to a source location. An Error’s sites() is an ordered list of these: the primary culprit first, followed by related context (e.g. the other method(s) and cell(s) involved in a structural conflict, or the remaining members of a cycle).