diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-01-30 17:21:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 17:21:31 -0500 |
commit | 00597ffde1ebb05a6c60ea7e09e6578c11f92820 (patch) | |
tree | 849b6b22c07ed38a4b424c363c06435ea2de4fa9 /src/errors.rs | |
parent | 7d278a0383ce634f4fa3dd792e9b202582a6fde1 (diff) |
Refactor libdeno ES module interface. (#1624)
Allows for future asynchronous module loading.
Add support for import.meta.url
Fixes #1496
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index 0855e0079..74502acc5 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,5 +1,6 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. +use crate::js_errors::JSError; pub use crate::msg::ErrorKind; use crate::resolve_addr::ResolveAddrError; @@ -178,3 +179,20 @@ pub fn permission_denied() -> DenoError { String::from("permission denied"), ) } + +pub enum RustOrJsError { + Rust(DenoError), + Js(JSError), +} + +impl From<DenoError> for RustOrJsError { + fn from(e: DenoError) -> Self { + RustOrJsError::Rust(e) + } +} + +impl From<JSError> for RustOrJsError { + fn from(e: JSError) -> Self { + RustOrJsError::Js(e) + } +} |