diff --git a/examples/production-dependency/index.js b/examples/production-dependency/index.js index 3916263..8f2ea05 100644 --- a/examples/production-dependency/index.js +++ b/examples/production-dependency/index.js @@ -1,5 +1,5 @@ const puppeteer = require("puppeteer-core"); -const chromium = require('@sparticuz/chromium'); +const chromium = require("@sparticuz/chromium"); const handler = async () => { try { @@ -21,10 +21,9 @@ const handler = async () => { await page.close(); await browser.close(); - } catch (error) { throw new Error(error.message); } }; -handler(); +handler().then(() => console.log("Done")); diff --git a/examples/serverless-with-lambda-layer/index.js b/examples/serverless-with-lambda-layer/index.js index c246b67..039cdec 100644 --- a/examples/serverless-with-lambda-layer/index.js +++ b/examples/serverless-with-lambda-layer/index.js @@ -1,5 +1,5 @@ const puppeteer = require("puppeteer-core"); -const chromium = require('@sparticuz/chromium'); +const chromium = require("@sparticuz/chromium"); module.exports = { handler: async () => { @@ -22,9 +22,8 @@ module.exports = { await page.close(); await browser.close(); - } catch (error) { throw new Error(error.message); } - } + }, };