From 0f8299d011420408b9a432a2c01af387af9d5fb2 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Sun, 7 Nov 2021 15:33:56 +0100 Subject: [PATCH] fix(cli): don't panic when mapping unknown errors (#12659) Instead fallback to generic "Error" class, fixes #12590, also update WPT expectations --- cli/errors.rs | 3 ++- tools/wpt/expectation.json | 42 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/cli/errors.rs b/cli/errors.rs index b09c3c01ae..bd5793430f 100644 --- a/cli/errors.rs +++ b/cli/errors.rs @@ -70,12 +70,13 @@ pub(crate) fn get_error_class_name(e: &AnyError) -> &'static str { .map(get_resolution_error_class) }) .unwrap_or_else(|| { - panic!( + eprintln!( "Error '{}' contains boxed error of unknown type:{}", e, e.chain() .map(|e| format!("\n {:?}", e)) .collect::() ); + "Error" }) } diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json index 5afc59cd50..e9718b5002 100644 --- a/tools/wpt/expectation.json +++ b/tools/wpt/expectation.json @@ -3089,8 +3089,46 @@ "digest.https.any.worker.html": true }, "encrypt_decrypt": { - "aes_cbc.https.any.html": false, - "aes_cbc.https.any.worker.html": false, + "aes_cbc.https.any.html": [ + "AES-CBC 128-bit key without encrypt usage", + "AES-CBC 192-bit key without encrypt usage", + "AES-CBC 256-bit key without encrypt usage", + "AES-CBC 128-bit key with mismatched key and algorithm", + "AES-CBC 192-bit key with mismatched key and algorithm", + "AES-CBC 256-bit key with mismatched key and algorithm", + "AES-CBC 128-bit key without decrypt usage", + "AES-CBC 192-bit key without decrypt usage", + "AES-CBC 256-bit key without decrypt usage", + "AES-CBC 128-bit key, zeroPadChar", + "AES-CBC 128-bit key, bigPadChar", + "AES-CBC 128-bit key, inconsistentPadChars", + "AES-CBC 192-bit key, zeroPadChar", + "AES-CBC 192-bit key, bigPadChar", + "AES-CBC 192-bit key, inconsistentPadChars", + "AES-CBC 256-bit key, zeroPadChar", + "AES-CBC 256-bit key, bigPadChar", + "AES-CBC 256-bit key, inconsistentPadChars" + ], + "aes_cbc.https.any.worker.html": [ + "AES-CBC 128-bit key without encrypt usage", + "AES-CBC 192-bit key without encrypt usage", + "AES-CBC 256-bit key without encrypt usage", + "AES-CBC 128-bit key with mismatched key and algorithm", + "AES-CBC 192-bit key with mismatched key and algorithm", + "AES-CBC 256-bit key with mismatched key and algorithm", + "AES-CBC 128-bit key without decrypt usage", + "AES-CBC 192-bit key without decrypt usage", + "AES-CBC 256-bit key without decrypt usage", + "AES-CBC 128-bit key, zeroPadChar", + "AES-CBC 128-bit key, bigPadChar", + "AES-CBC 128-bit key, inconsistentPadChars", + "AES-CBC 192-bit key, zeroPadChar", + "AES-CBC 192-bit key, bigPadChar", + "AES-CBC 192-bit key, inconsistentPadChars", + "AES-CBC 256-bit key, zeroPadChar", + "AES-CBC 256-bit key, bigPadChar", + "AES-CBC 256-bit key, inconsistentPadChars" + ], "aes_ctr.https.any.html": [ "AES-CTR 128-bit key", "AES-CTR 192-bit key",