mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
[api-minor] Remove the image-related error message prefixes
Other custom errors, based on `BaseException`, do not use such a format.
This commit is contained in:
parent
5ad42c13ad
commit
912b57b95d
8 changed files with 33 additions and 15 deletions
|
@ -1,4 +1,5 @@
|
|||
import {
|
||||
JpegError,
|
||||
JpegImage,
|
||||
setVerbosityLevel,
|
||||
VerbosityLevel,
|
||||
|
@ -7,9 +8,12 @@ import {
|
|||
// Avoid unnecessary console "spam", by ignoring `info`/`warn` calls.
|
||||
setVerbosityLevel(VerbosityLevel.ERRORS);
|
||||
|
||||
const ignored = ["Cannot read properties", "JPEG error"];
|
||||
const ignored = ["Cannot read properties"];
|
||||
|
||||
function ignoredError(error) {
|
||||
if (error instanceof JpegError) {
|
||||
return true;
|
||||
}
|
||||
return ignored.some(message => error.message.includes(message));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue