diff options
Diffstat (limited to 'cli/errors.rs')
-rw-r--r-- | cli/errors.rs | 10 |
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), + } + } +} |