owl_structural_model/
error.rs1use std::fmt::{Display, Formatter};
4
5#[derive(Debug, Clone, PartialEq, Eq)]
7pub enum StructuralModelError {
8 Empty {
10 kind: &'static str,
12 },
13 InvalidFormat {
15 kind: &'static str,
17 value: String,
19 message: &'static str,
21 },
22}
23
24impl Display for StructuralModelError {
25 fn fmt(&self, formatter: &mut Formatter<'_>) -> std::fmt::Result {
26 match self {
27 Self::Empty { kind } => write!(formatter, "{kind} must not be empty"),
28 Self::InvalidFormat {
29 kind,
30 value,
31 message,
32 } => write!(formatter, "invalid {kind}: {message} (got: {value})"),
33 }
34 }
35}
36
37impl std::error::Error for StructuralModelError {}