Add catch to image grid generator
This commit is contained in:
parent
1796f2519e
commit
659906e562
1 changed files with 38 additions and 33 deletions
|
@ -26,6 +26,7 @@ export default class ImageHelper {
|
|||
const ctx = canvas.getContext("2d");
|
||||
|
||||
for (let i = 0; i < cards.length; i++) {
|
||||
try {
|
||||
const card = cards[i];
|
||||
|
||||
const filePath = path.join(process.env.DATA_DIR!, "cards", card.path);
|
||||
|
@ -67,6 +68,10 @@ export default class ImageHelper {
|
|||
|
||||
ctx.drawImage(image, imageX, imageY);
|
||||
}
|
||||
catch (e) {
|
||||
AppLogger.CatchError("ImageHelper", e);
|
||||
}
|
||||
}
|
||||
|
||||
return canvas.toBuffer();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue