aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/seld
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-external-packages/src/seld')
-rw-r--r--crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs b/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs
index 867f18e3..9d3eaa57 100644
--- a/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs
+++ b/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs
@@ -25,33 +25,21 @@ pub struct ParsingExceptionDetails {
#[derive(Debug)]
pub struct ParsingException {
- pub message: String,
- pub code: i64,
+ inner: shirabe_php_shim::Exception,
pub(crate) details: Box<ParsingExceptionDetails>,
}
impl ParsingException {
pub fn new(message: String, details: ParsingExceptionDetails) -> Self {
Self {
- message,
- code: 0,
+ inner: shirabe_php_shim::Exception::new(message),
details: Box::new(details),
}
}
- pub fn get_message(&self) -> &str {
- &self.message
- }
-
pub fn get_details(&self) -> &ParsingExceptionDetails {
&self.details
}
}
-impl std::fmt::Display for ParsingException {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "{}", self.message)
- }
-}
-
-impl std::error::Error for ParsingException {}
+shirabe_php_shim::impl_php_exception!(ParsingException, inner, r"Seld\JsonLint\ParsingException");