diff options
Diffstat (limited to 'crates/shirabe/src/exception')
| -rw-r--r-- | crates/shirabe/src/exception/irrecoverable_download_exception.rs | 12 | ||||
| -rw-r--r-- | crates/shirabe/src/exception/no_ssl_exception.rs | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/crates/shirabe/src/exception/irrecoverable_download_exception.rs b/crates/shirabe/src/exception/irrecoverable_download_exception.rs index a8d2dbb4..ed424eff 100644 --- a/crates/shirabe/src/exception/irrecoverable_download_exception.rs +++ b/crates/shirabe/src/exception/irrecoverable_download_exception.rs @@ -5,10 +5,14 @@ use shirabe_php_shim::RuntimeException; #[derive(Debug)] pub struct IrrecoverableDownloadException(pub RuntimeException); -impl std::fmt::Display for IrrecoverableDownloadException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) +impl IrrecoverableDownloadException { + pub fn new(message: String) -> Self { + Self(RuntimeException::new(message)) } } -impl std::error::Error for IrrecoverableDownloadException {} +shirabe_php_shim::impl_php_exception!( + IrrecoverableDownloadException, + 0, + r"Composer\Exception\IrrecoverableDownloadException" +); diff --git a/crates/shirabe/src/exception/no_ssl_exception.rs b/crates/shirabe/src/exception/no_ssl_exception.rs index 968ecfd7..b0470e58 100644 --- a/crates/shirabe/src/exception/no_ssl_exception.rs +++ b/crates/shirabe/src/exception/no_ssl_exception.rs @@ -6,10 +6,10 @@ use shirabe_php_shim::RuntimeException; #[derive(Debug)] pub struct NoSslException(pub RuntimeException); -impl std::fmt::Display for NoSslException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) +impl NoSslException { + pub fn new(message: String) -> Self { + Self(RuntimeException::new(message)) } } -impl std::error::Error for NoSslException {} +shirabe_php_shim::impl_php_exception!(NoSslException, 0, r"Composer\Exception\NoSslException"); |
