Skip to content

Commit 0033bbe

Browse files
committed
Used reject instead of throw with 'new Error(...)' to avoid node crashing.
1 parent c043b88 commit 0033bbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ResembleHelper extends Helper {
4040
if (err) {
4141
reject(err);
4242
} else {
43-
if(!data.isSameDimensions) throw new Error("The images are not of same dimensions. Please use images of same dimensions so as to avoid any unexpected results.")
43+
if(!data.isSameDimensions) reject(new Error("The images are not of same dimensions. Please use images of same dimensions so as to avoid any unexpected results."));
4444
resolve(data);
4545
if (data.misMatchPercentage >= tolerance) {
4646
mkdirp(getDirName(this.config.diffFolder + diffImage), function (err) {

0 commit comments

Comments
 (0)