From dcb4ffb93a380710c32cc212b937ea38db5ceacc Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 25 Nov 2022 18:29:48 -0500 Subject: refactor: move dts files, diagnostics.rs, and tsc.rs to tsc folder (#16820) --- cli/errors.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'cli/errors.rs') diff --git a/cli/errors.rs b/cli/errors.rs index fbf9da8e0..2b5d19503 100644 --- a/cli/errors.rs +++ b/cli/errors.rs @@ -9,8 +9,6 @@ //! Diagnostics are compile-time type errors, whereas JsErrors are runtime //! exceptions. -use crate::emit::GraphError; - use deno_ast::Diagnostic; use deno_core::error::AnyError; use deno_graph::ModuleGraphError; @@ -25,11 +23,7 @@ fn get_diagnostic_class(_: &Diagnostic) -> &'static str { "SyntaxError" } -fn get_graph_error_class(err: &GraphError) -> &'static str { - get_module_graph_error_class(&err.0) -} - -pub fn get_module_graph_error_class(err: &ModuleGraphError) -> &'static str { +fn get_module_graph_error_class(err: &ModuleGraphError) -> &'static str { match err { ModuleGraphError::LoadingErr(_, err) => get_error_class_name(err.as_ref()), ModuleGraphError::InvalidSource(_, _) @@ -60,7 +54,6 @@ pub fn get_error_class_name(e: &AnyError) -> &'static str { .map(get_import_map_error_class) }) .or_else(|| e.downcast_ref::().map(get_diagnostic_class)) - .or_else(|| e.downcast_ref::().map(get_graph_error_class)) .or_else(|| { e.downcast_ref::() .map(get_module_graph_error_class) -- cgit v1.2.3