diff options
author | Bert Belder <bertbelder@gmail.com> | 2020-09-14 18:48:57 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2020-09-15 01:50:52 +0200 |
commit | f5b40c918c7d602827622d167728a3e7bae87d9d (patch) | |
tree | fb51722e043f4d6bce64a2c7e897cce4ead06c82 /cli/ast.rs | |
parent | 3da20d19a14ab6838897d281f1b11e49d68bd1a7 (diff) |
refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476)
Diffstat (limited to 'cli/ast.rs')
-rw-r--r-- | cli/ast.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/ast.rs b/cli/ast.rs index 8814bf297..846967331 100644 --- a/cli/ast.rs +++ b/cli/ast.rs @@ -1,8 +1,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use crate::msg::MediaType; - -use deno_core::ErrBox; +use deno_core::error::AnyError; use deno_core::ModuleSpecifier; use std::error::Error; use std::fmt; @@ -43,7 +42,7 @@ use swc_ecmascript::transforms::react; use swc_ecmascript::transforms::typescript; use swc_ecmascript::visit::FoldWith; -type Result<V> = result::Result<V, ErrBox>; +type Result<V> = result::Result<V, AnyError>; static TARGET: JscTarget = JscTarget::Es2020; @@ -357,9 +356,9 @@ pub fn parse( let mut diagnostic = err.into_diagnostic(&handler); diagnostic.emit(); - ErrBox::from(DiagnosticBuffer::from_error_buffer(error_buffer, |span| { + DiagnosticBuffer::from_error_buffer(error_buffer, |span| { sm.lookup_char_pos(span.lo) - })) + }) })?; let leading_comments = comments.with_leading(module.span.lo, |comments| comments.to_vec()); |