diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-02-28 16:19:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-28 16:19:04 -0500 |
commit | b3b989ffdca61403cdd7ca94bd9256159864469e (patch) | |
tree | de53cd24d4ee4726fdd8f66c32ebd6016d3f6ad7 /src/ops.rs | |
parent | b0c7b54f692ecc866d4f70bfa384631523bbf924 (diff) |
Use deno_core::JSError in deno (#1855)
src/js_errors.rs takes care of source maps and color while
core/js_errors.rs is just the basic struct.
Diffstat (limited to 'src/ops.rs')
-rw-r--r-- | src/ops.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ops.rs b/src/ops.rs index 8f32ebc03..3bd2e6894 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -10,7 +10,8 @@ use crate::isolate::Buf; use crate::isolate::Isolate; use crate::isolate::IsolateState; use crate::isolate::Op; -use crate::js_errors::JSError; +use crate::js_errors::apply_source_map; +use crate::js_errors::JSErrorColor; use crate::libdeno; use crate::msg; use crate::msg_util; @@ -21,6 +22,7 @@ use crate::resources::table_entries; use crate::resources::Resource; use crate::tokio_util; use crate::version; +use deno_core::JSError; use flatbuffers::FlatBufferBuilder; use futures; use futures::Async; @@ -302,8 +304,8 @@ fn op_format_error( let orig_error = String::from(inner.error().unwrap()); let js_error = JSError::from_v8_exception(&orig_error).unwrap(); - let js_error_mapped = js_error.apply_source_map(&state.dir); - let js_error_string = js_error_mapped.to_string(); + let js_error_mapped = apply_source_map(&js_error, &state.dir); + let js_error_string = JSErrorColor(&js_error_mapped).to_string(); let mut builder = FlatBufferBuilder::new(); let new_error = builder.create_string(&js_error_string); |