diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-18 00:07:23 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-18 00:15:34 +0900 |
| commit | 6b0296e195942c0c6e48f013e8af28170507d486 (patch) | |
| tree | 1c4ccae583bb422b8daf607fc326098aff4e4a6f /crates/shirabe-php-shim/src | |
| parent | 5461c8cffe839b49ae38e67146b4672bfd96d687 (diff) | |
| download | php-shirabe-6b0296e195942c0c6e48f013e8af28170507d486.tar.gz php-shirabe-6b0296e195942c0c6e48f013e8af28170507d486.tar.zst php-shirabe-6b0296e195942c0c6e48f013e8af28170507d486.zip | |
fix(compile): impl std::error::Error for custom error types
Diffstat (limited to 'crates/shirabe-php-shim/src')
| -rw-r--r-- | crates/shirabe-php-shim/src/lib.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index d1db732..a8793cf 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -65,6 +65,14 @@ pub struct Exception { pub code: i64, } +impl std::fmt::Display for Exception { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + todo!() + } +} + +impl std::error::Error for Exception {} + #[derive(Debug)] pub struct RuntimeException { pub message: String, @@ -77,6 +85,8 @@ impl std::fmt::Display for RuntimeException { } } +impl std::error::Error for RuntimeException {} + #[derive(Debug)] pub struct UnexpectedValueException { pub message: String, @@ -89,6 +99,8 @@ impl std::fmt::Display for UnexpectedValueException { } } +impl std::error::Error for UnexpectedValueException {} + #[derive(Debug)] pub struct InvalidArgumentException { pub message: String, @@ -101,6 +113,8 @@ impl std::fmt::Display for InvalidArgumentException { } } +impl std::error::Error for InvalidArgumentException {} + #[derive(Debug)] pub struct LogicException { pub message: String, @@ -113,6 +127,8 @@ impl std::fmt::Display for LogicException { } } +impl std::error::Error for LogicException {} + #[derive(Debug)] pub struct BadMethodCallException { pub message: String, @@ -125,6 +141,8 @@ impl std::fmt::Display for BadMethodCallException { } } +impl std::error::Error for BadMethodCallException {} + #[derive(Debug)] pub struct OutOfBoundsException { pub message: String, @@ -137,6 +155,8 @@ impl std::fmt::Display for OutOfBoundsException { } } +impl std::error::Error for OutOfBoundsException {} + #[derive(Debug)] pub struct ErrorException { pub message: String, @@ -152,6 +172,8 @@ impl std::fmt::Display for ErrorException { } } +impl std::error::Error for ErrorException {} + pub fn is_bool(_value: &PhpMixed) -> bool { todo!() } |
