Skip to main content

ontocore_edit/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum EditError {
5    #[error("empty transaction")]
6    Empty,
7
8    #[error("transaction mixes Turtle and OBO changes")]
9    MixedFormats,
10
11    #[error("change is not invertible: {0}")]
12    NotInvertible(String),
13
14    #[error("validation failed: {0}")]
15    Validation(String),
16
17    #[error("unsupported format for transaction: {0}")]
18    UnsupportedFormat(String),
19
20    #[error(transparent)]
21    Owl(#[from] ontocore_owl::OwlError),
22
23    #[error(transparent)]
24    Obo(#[from] ontocore_obo::OboError),
25
26    #[error(transparent)]
27    Json(#[from] serde_json::Error),
28}
29
30pub type Result<T> = std::result::Result<T, EditError>;