parallel_disk_usage/
runtime_error.rs

1use derive_more::{Display, Error};
2
3/// Error caused by the CLI program.
4#[derive(Debug, Display, Error)]
5#[non_exhaustive]
6pub enum RuntimeError {
7    /// When it fails to write JSON representation of
8    /// [DataTreeReflection](crate::data_tree::Reflection) to stdout.
9    #[display("SerializationFailure: {_0}")]
10    SerializationFailure(serde_json::Error),
11    /// When it fails to read JSON representation of
12    /// [DataTreeReflection](crate::data_tree::Reflection) from stdin.
13    #[display("DeserializationFailure: {_0}")]
14    DeserializationFailure(serde_json::Error),
15    /// When both `--json-input` and file names are both specified.
16    #[display("JsonInputArgConflict: Arguments exist alongside --json-input")]
17    JsonInputArgConflict,
18    /// When input JSON data is not a valid tree.
19    #[display("InvalidInputReflection: {_0}")]
20    InvalidInputReflection(#[error(not(source))] String),
21}