Merge pull request #13941 from Snuffleupagus/MessageHandler-PasswordException

Ensure that `PasswordException` is handled correctly in the `wrapReason` function
This commit is contained in:
Tim van der Meij 2021-08-29 14:23:46 +02:00 committed by GitHub
commit 13bc661681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@ import {
assert, assert,
createPromiseCapability, createPromiseCapability,
MissingPDFException, MissingPDFException,
PasswordException,
UnexpectedResponseException, UnexpectedResponseException,
UnknownErrorException, UnknownErrorException,
warn, warn,
@ -64,6 +65,8 @@ function wrapReason(reason) {
return new AbortException(reason.message); return new AbortException(reason.message);
case "MissingPDFException": case "MissingPDFException":
return new MissingPDFException(reason.message); return new MissingPDFException(reason.message);
case "PasswordException":
return new PasswordException(reason.message, reason.code);
case "UnexpectedResponseException": case "UnexpectedResponseException":
return new UnexpectedResponseException(reason.message, reason.status); return new UnexpectedResponseException(reason.message, reason.status);
case "UnknownErrorException": case "UnknownErrorException":