summaryrefslogtreecommitdiff
path: root/cli/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/errors.rs')
-rw-r--r--cli/errors.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/errors.rs b/cli/errors.rs
index 4ea0e000a..f867ebbcc 100644
--- a/cli/errors.rs
+++ b/cli/errors.rs
@@ -15,6 +15,7 @@ use deno_graph::ModuleError;
use deno_graph::ModuleGraphError;
use deno_graph::ResolutionError;
use import_map::ImportMapError;
+use std::fmt::Write;
fn get_import_map_error_class(_: &ImportMapError) -> &'static str {
"URIError"
@@ -70,7 +71,10 @@ pub fn get_error_class_name(e: &AnyError) -> &'static str {
log::warn!(
"Error '{}' contains boxed error of unknown type:{}",
e,
- e.chain().map(|e| format!("\n {e:?}")).collect::<String>()
+ e.chain().fold(String::new(), |mut output, e| {
+ let _ = write!(output, "\n {e:?}");
+ output
+ })
);
}
"Error"