1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::path::PathBuf;

use thiserror::Error;

/// An enum representing the errors that can occur.
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
    /// The file is not a XML file.
    #[error("File is not a XML file.")]
    InvalidFileType,

    /// The file was not found at the specififed path.
    #[error("File was not found at the specified path: {:?}.", 0)]
    FileNotFound(PathBuf),

    /// An unknown error occurred.
    #[error(transparent)]
    IO(#[from] std::io::Error),

    /// A parsing error occurred.
    #[error(transparent)]
    ParsingError(#[from] serde_xml_rs::Error),
}