Skip to content

Commit 11bf779

Browse files
committed
Add error for file not found
1 parent 54838d4 commit 11bf779

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/utils/processImage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export function sliceImage(
6868
});
6969
}
7070
});
71+
72+
if (foundImage === false) {
73+
throw new Error(`Could not find ${filename}`);
74+
}
7175
}
7276

7377
/**

utils/processImage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ function sliceImage(filename, width, height, canvasWidth, canvasHeight, scale, c
4040
});
4141
}
4242
});
43+
if (foundImage === false) {
44+
throw new Error(`Could not find ${filename}`);
45+
}
4346
}
4447
exports.sliceImage = sliceImage;
4548
/**

0 commit comments

Comments
 (0)