summaryrefslogtreecommitdiff
path: root/cli/errors.rs
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2021-01-08 16:57:37 -0800
committerGitHub <noreply@github.com>2021-01-09 01:57:37 +0100
commitf3ead9c6a7184d2b592f018795f73d34399a9c83 (patch)
tree15c5ca5b4eef85bf9bda4673176cd34346f91edd /cli/errors.rs
parent9cf82d3c662989f5fffa8d1981233979245af84a (diff)
refactor: Print cause chain when downcasting AnyError fails (#9059)
Diffstat (limited to 'cli/errors.rs')
-rw-r--r--cli/errors.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/errors.rs b/cli/errors.rs
index 29fd428c8..b631f1b71 100644
--- a/cli/errors.rs
+++ b/cli/errors.rs
@@ -32,6 +32,12 @@ pub(crate) fn get_error_class_name(e: &AnyError) -> &'static str {
.map(get_diagnostic_class)
})
.unwrap_or_else(|| {
- panic!("Error '{}' contains boxed error of unknown type", e);
+ panic!(
+ "Error '{}' contains boxed error of unknown type:{}",
+ e,
+ e.chain()
+ .map(|e| format!("\n {:?}", e))
+ .collect::<String>()
+ );
})
}