Failed to locate ByteRange is an expected error

We don't need to capture an exception for this, instead
just capture the message and move on.
This commit is contained in:
Evert Timberg 2021-09-30 09:17:29 -04:00
parent 1db3095ec1
commit 754aaa0374
1 changed files with 5 additions and 4 deletions

View File

@ -112,11 +112,12 @@ async function loadPDF(signedPdfBuffer : ArrayBuffer): Promise<HashTable<Receipt
}
} catch (e) {
console.error(e);
Sentry.captureException(e);
if (e.message.includes('Failed to locate ByteRange')) {
e.message = 'Sorry. Selected PDF file is not digitally signed. Please download official copy from Step 1 and retry. Thanks.'
e.message = 'Sorry. Selected PDF file is not digitally signed. Please download official copy from Step 1 and retry. Thanks.';
Sentry.captureMessage("Attempted to generate a pass from a PDF that was not digitally signed.");
} else {
console.error(e);
Sentry.captureException(e);
}
return Promise.reject(e);
}