window_enumerator_formatter/
error.rs

1use thiserror::Error;
2
3/// Errors that can occur during formatting operations.
4#[derive(Error, Debug)]
5pub enum FormatError {
6    /// The input window list is empty.
7    #[error("Cannot format empty window list")]
8    EmptyInput,
9
10    /// Invalid field name in template.
11    #[error("Invalid field name: {field}")]
12    InvalidField {
13        /// The invalid field name.
14        field: String,
15    },
16
17    /// Template parsing error.
18    #[error("Template parsing error: {message}")]
19    TemplateError {
20        /// Error message.
21        message: String,
22    },
23
24    /// Serialization error.
25    #[error("Serialization error: {source}")]
26    SerializationError {
27        /// The underlying error.
28        #[from]
29        source: serde_json::Error,
30    },
31
32    /// YAML serialization error.
33    #[error("YAML serialization error: {source}")]
34    YamlError {
35        /// The underlying error.
36        #[from]
37        source: serde_yaml::Error,
38    },
39
40    /// Other unspecified errors.
41    #[error("Formatting error: {message}")]
42    Other {
43        /// Error message.
44        message: String,
45    },
46}