icedwright_semantics/error.rs
1//! The crate's error type.
2
3/// YAML and path parse errors. Folded into `icedwright::Error` with `From`.
4#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
5#[non_exhaustive]
6pub enum Error {
7 /// The YAML could not be read.
8 #[error("YAML line {line}, column {column}: {message}")]
9 Yaml {
10 /// The line, from 1.
11 line: usize,
12 /// The column, from 1.
13 column: usize,
14 /// What was wrong.
15 message: String,
16 },
17 /// A node path could not be read.
18 #[error("invalid node path at byte {offset}: {message}\n{input}")]
19 Path {
20 /// The path.
21 input: String,
22 /// The byte offset of the problem.
23 offset: usize,
24 /// What was wrong.
25 message: String,
26 },
27}