Merge pull request #14628 from Snuffleupagus/issue-14626
When `stopAtErrors` is set, throw rather than warn when exceeding `maxImageSize` (issue 14626)
This commit is contained in:
commit
5242c38af5
@ -576,8 +576,13 @@ class PartialEvaluator {
|
|||||||
}
|
}
|
||||||
const maxImageSize = this.options.maxImageSize;
|
const maxImageSize = this.options.maxImageSize;
|
||||||
if (maxImageSize !== -1 && w * h > maxImageSize) {
|
if (maxImageSize !== -1 && w * h > maxImageSize) {
|
||||||
warn("Image exceeded maximum allowed size and was removed.");
|
const msg = "Image exceeded maximum allowed size and was removed.";
|
||||||
return;
|
|
||||||
|
if (this.options.ignoreErrors) {
|
||||||
|
warn(msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Error(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
let optionalContent;
|
let optionalContent;
|
||||||
|
Loading…
Reference in New Issue
Block a user