summaryrefslogtreecommitdiff
path: root/cli/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/errors.rs')
-rw-r--r--cli/errors.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/errors.rs b/cli/errors.rs
index c2539df7e..fce286f15 100644
--- a/cli/errors.rs
+++ b/cli/errors.rs
@@ -9,7 +9,7 @@
//! Diagnostics are compile-time type errors, whereas JsErrors are runtime
//! exceptions.
-use deno_ast::Diagnostic;
+use deno_ast::ParseDiagnostic;
use deno_core::error::AnyError;
use deno_graph::source::ResolveError;
use deno_graph::ModuleError;
@@ -22,7 +22,7 @@ fn get_import_map_error_class(_: &ImportMapError) -> &'static str {
"URIError"
}
-fn get_diagnostic_class(_: &Diagnostic) -> &'static str {
+fn get_diagnostic_class(_: &ParseDiagnostic) -> &'static str {
"SyntaxError"
}
@@ -67,7 +67,10 @@ pub fn get_error_class_name(e: &AnyError) -> &'static str {
e.downcast_ref::<ImportMapError>()
.map(get_import_map_error_class)
})
- .or_else(|| e.downcast_ref::<Diagnostic>().map(get_diagnostic_class))
+ .or_else(|| {
+ e.downcast_ref::<ParseDiagnostic>()
+ .map(get_diagnostic_class)
+ })
.or_else(|| {
e.downcast_ref::<ModuleGraphError>()
.map(get_module_graph_error_class)