Skip to content

Commit

Permalink
Updates screenshot timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmerfield committed Dec 18, 2023
1 parent e337e5b commit 5d37749
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/templates/screenshots.js
Expand Up @@ -74,11 +74,20 @@ const main = async () => {

console.log("Taking screenshots");
for (const screenshot of screenshots) {
await takeScreenshot(screenshot);
try {
await takeScreenshot(screenshot);
} catch (error) {
console.error(error);
}
}
};

const takeScreenshot = async ({ url, destination }) => {
// throw error after 10 seconds
const timeout = setTimeout(() => {
throw new Error(`Screenshot of ${url} timed out`);
}, 10000);

await fs.ensureDir(dirname(destination));

const path = `${destination}.png`;
Expand Down

0 comments on commit 5d37749

Please sign in to comment.