From f3ead9c6a7184d2b592f018795f73d34399a9c83 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 8 Jan 2021 16:57:37 -0800 Subject: refactor: Print cause chain when downcasting AnyError fails (#9059) --- cli/errors.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cli/errors.rs') 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::() + ); }) } -- cgit v1.2.3