diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-11-25 18:29:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-25 18:29:48 -0500 |
commit | dcb4ffb93a380710c32cc212b937ea38db5ceacc (patch) | |
tree | 18bf860912a14b84287bb8dbafdc41c5e3cdc6ab /cli/errors.rs | |
parent | 0cc90d9246ff2c392457632d5030eaca2ca1ca6f (diff) |
refactor: move dts files, diagnostics.rs, and tsc.rs to tsc folder (#16820)
Diffstat (limited to 'cli/errors.rs')
-rw-r--r-- | cli/errors.rs | 9 |
1 files changed, 1 insertions, 8 deletions
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::<Diagnostic>().map(get_diagnostic_class)) - .or_else(|| e.downcast_ref::<GraphError>().map(get_graph_error_class)) .or_else(|| { e.downcast_ref::<ModuleGraphError>() .map(get_module_graph_error_class) |