summaryrefslogtreecommitdiff
path: root/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs
index 74502acc5..3a6937495 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -180,6 +180,7 @@ pub fn permission_denied() -> DenoError {
)
}
+#[derive(Debug)]
pub enum RustOrJsError {
Rust(DenoError),
Js(JSError),
@@ -196,3 +197,12 @@ impl From<JSError> for RustOrJsError {
RustOrJsError::Js(e)
}
}
+
+impl fmt::Display for RustOrJsError {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ RustOrJsError::Rust(e) => e.fmt(f),
+ RustOrJsError::Js(e) => e.fmt(f),
+ }
+ }
+}