aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/component/filesystem/exception/io_exception.rs
blob: a5f28448e06479a3ad0c5a5bb68f8a04a4bd9396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#[derive(Debug)]
pub struct IOException {
    pub message: String,
    pub code: i64,
    pub path: Option<String>,
}

impl IOException {
    pub fn new(
        message: String,
        code: i64,
        _previous: Option<Box<dyn std::error::Error + Send + Sync>>,
        path: Option<String>,
    ) -> Self {
        Self {
            message,
            code,
            path,
        }
    }
}

impl std::fmt::Display for IOException {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.message)
    }
}

impl std::error::Error for IOException {}