From 9ea3fa074748eebd1d260dc41b908c32dfbf6793 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 28 Aug 2021 11:58:02 +0200 Subject: [PATCH] Ensure that `PasswordException` is handled correctly in the `wrapReason` function While running the unit-tests with some logging statements added to this code, I noticed that `PasswordException` was missing from the list of potential Errors that could be passed to the `wrapReason` function. --- src/shared/message_handler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/message_handler.js b/src/shared/message_handler.js index 372427f8a..bf4e81f8d 100644 --- a/src/shared/message_handler.js +++ b/src/shared/message_handler.js @@ -18,6 +18,7 @@ import { assert, createPromiseCapability, MissingPDFException, + PasswordException, UnexpectedResponseException, UnknownErrorException, warn, @@ -64,6 +65,8 @@ function wrapReason(reason) { return new AbortException(reason.message); case "MissingPDFException": return new MissingPDFException(reason.message); + case "PasswordException": + return new PasswordException(reason.message, reason.code); case "UnexpectedResponseException": return new UnexpectedResponseException(reason.message, reason.status); case "UnknownErrorException":