We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1371524 commit 9ca1863Copy full SHA for 9ca1863
src/main.ts
@@ -244,8 +244,14 @@ async function main() {
244
245
if (screenshotPart != null && screenshotTime != null) {
246
eventManager.at(screenshotTime * millis, async (t) => {
247
- const result = await client.framebufferRead(screenshotPart);
248
- writeFileSync(screenshotFile, result.png, 'base64');
+ try {
+ const result = await client.framebufferRead(screenshotPart);
249
+ writeFileSync(screenshotFile, result.png, 'base64');
250
+ } catch (err) {
251
+ console.error('Error taking screenshot:', (err as Error).toString());
252
+ client.close();
253
+ process.exit(1);
254
+ }
255
});
256
}
257
0 commit comments