encounter/error.rs
1//! Crate error types.
2
3use thiserror::Error;
4
5/// Errors that can occur in the `encounter` crate.
6#[derive(Debug, Error)]
7pub enum Error {
8 /// A catalog file could not be parsed.
9 #[error("catalog parse error in {path}: {reason}")]
10 CatalogParse {
11 /// Path of the file that failed.
12 path: String,
13 /// What went wrong.
14 reason: String,
15 },
16
17 /// A resolution protocol was invoked with invalid input.
18 #[error("resolution error: {0}")]
19 Resolution(String),
20
21 /// An IO error during catalog loading.
22 #[error("io error: {0}")]
23 Io(#[from] std::io::Error),
24
25 /// A TOML deserialization error.
26 #[error("toml error: {0}")]
27 Toml(#[from] toml::de::Error),
28}