aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/filesystem_exception.rs
blob: 6e90e3283d21d17039951db998360b1139a02eeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! ref: composer/src/Composer/Downloader/FilesystemException.php

use shirabe_php_shim::Exception;

#[derive(Debug)]
pub struct FilesystemException(pub Exception);

impl FilesystemException {
    pub fn new(message: String, code: i64) -> Self {
        FilesystemException(Exception::with_code(
            format!("Filesystem exception: \n{}", message),
            code,
        ))
    }
}

shirabe_php_shim::impl_php_exception!(
    FilesystemException,
    0,
    r"Composer\Downloader\FilesystemException"
);