powerio_dist/error.rs
1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Debug, Error)]
6#[non_exhaustive]
7pub enum Error {
8 #[error("io error reading {path}: {source}")]
9 Io {
10 path: String,
11 #[source]
12 source: std::io::Error,
13 },
14
15 #[error("malformed {format} JSON: {message}")]
16 Json {
17 format: &'static str,
18 message: String,
19 },
20
21 #[error("unknown distribution format `{0}` (expected dss, bmopf, or pmd)")]
22 UnknownFormat(String),
23}