summaryrefslogtreecommitdiff
path: root/cli/errors.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-04-16 15:13:42 -0400
committerGitHub <noreply@github.com>2019-04-16 15:13:42 -0400
commit1bfb44336914a775cd01120165517394d30aec23 (patch)
tree2f126b5f36ad8fe2ddd9cae118058affd413c68d /cli/errors.rs
parent0c463582206881b6461742633a67f51632db614e (diff)
Implement async module loading in CLI (#2084)
Diffstat (limited to 'cli/errors.rs')
-rw-r--r--cli/errors.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/errors.rs b/cli/errors.rs
index 3873f70ff..bd3e7ba73 100644
--- a/cli/errors.rs
+++ b/cli/errors.rs
@@ -217,3 +217,13 @@ impl fmt::Display for RustOrJsError {
}
}
}
+
+// TODO(ry) This is ugly. They are essentially the same type.
+impl From<deno::JSErrorOr<DenoError>> for RustOrJsError {
+ fn from(e: deno::JSErrorOr<DenoError>) -> Self {
+ match e {
+ deno::JSErrorOr::JSError(err) => RustOrJsError::Js(err),
+ deno::JSErrorOr::Other(err) => RustOrJsError::Rust(err),
+ }
+ }
+}