aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-filesystem/src/exception/io_exception.rs
blob: 07a189c33876f7f7e88e679536cffda86d70c9b5 (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
//! ref: composer/vendor/symfony/filesystem/Exception/IOException.php

use shirabe_php_shim::RuntimeException;

#[derive(Debug)]
pub struct IOException {
    inner: RuntimeException,
    pub path: Option<String>,
}

impl IOException {
    pub fn new(
        message: String,
        code: i64,
        previous: Option<std::sync::Arc<anyhow::Error>>,
        path: Option<String>,
    ) -> Self {
        Self {
            inner: RuntimeException::with_code_and_previous(message, code, previous),
            path,
        }
    }
}

shirabe_php_shim::impl_php_exception!(
    IOException,
    inner,
    r"Symfony\Component\Filesystem\Exception\IOException"
);