diff options
Diffstat (limited to 'crates/shirabe-php-shim/src/exception.rs')
| -rw-r--r-- | crates/shirabe-php-shim/src/exception.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/shirabe-php-shim/src/exception.rs b/crates/shirabe-php-shim/src/exception.rs index f87ce7c8..281058de 100644 --- a/crates/shirabe-php-shim/src/exception.rs +++ b/crates/shirabe-php-shim/src/exception.rs @@ -269,6 +269,12 @@ macro_rules! impl_php_exception { ::anyhow::Error::new($crate::AnyThrowable::new(exception)) } } + + impl From<Box<$ty>> for ::anyhow::Error { + fn from(exception: Box<$ty>) -> Self { + ::anyhow::Error::new($crate::AnyThrowable::new(*exception)) + } + } }; // For an exception the port cannot let travel as a Rust error, because its state is not // `Send + Sync`. It gets the accessors but no [`Throwable`], so asking for it in a `catch` |
