Skip to content

Commit 68217ff

Browse files
committed
Thumbnails: Some more logging
1 parent fa61817 commit 68217ff

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

utils/thumbnails.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,13 @@ export const handler: Handler = async (event: any, context?: any) => {
255255
const max = meta2max.get(meta) || MAX;
256256
const random = randomInt(max, min);
257257
const realmove = Math.min(random, g.stack.length - 1);
258-
g.load(realmove);
259-
const json = g.render({});
258+
let json: any;
259+
try {
260+
g.load(realmove);
261+
json = g.render({});
262+
} catch (ex) {
263+
throw new Error(`An error occured when loading a specific move and trying to render it. ${JSON.stringify({meta, min, max, random, realmove, totalMoves: g.stack.length, sk: rec.sk})}`);
264+
}
260265
allRecs.set(meta, JSON.stringify(json));
261266
}
262267
console.log(`Generated ${allRecs.size} thumbnails`);

0 commit comments

Comments
 (0)