aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/filesystem_exception.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/downloader/filesystem_exception.rs')
-rw-r--r--crates/shirabe/src/downloader/filesystem_exception.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/crates/shirabe/src/downloader/filesystem_exception.rs b/crates/shirabe/src/downloader/filesystem_exception.rs
index f0aa831f..6e90e328 100644
--- a/crates/shirabe/src/downloader/filesystem_exception.rs
+++ b/crates/shirabe/src/downloader/filesystem_exception.rs
@@ -7,17 +7,15 @@ pub struct FilesystemException(pub Exception);
impl FilesystemException {
pub fn new(message: String, code: i64) -> Self {
- FilesystemException(Exception {
- message: format!("Filesystem exception: \n{}", message),
+ FilesystemException(Exception::with_code(
+ format!("Filesystem exception: \n{}", message),
code,
- })
+ ))
}
}
-impl std::fmt::Display for FilesystemException {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- self.0.fmt(f)
- }
-}
-
-impl std::error::Error for FilesystemException {}
+shirabe_php_shim::impl_php_exception!(
+ FilesystemException,
+ 0,
+ r"Composer\Downloader\FilesystemException"
+);