diff --git a/server/lambda/screenshot.js b/server/lambda/screenshot.js index 2cd0664..5d4e473 100644 --- a/server/lambda/screenshot.js +++ b/server/lambda/screenshot.js @@ -31,8 +31,8 @@ exports.handler = async (event, context, callback) => { browser = await puppeteer.launch({ args: chromium.args, defaultViewport: { width: 800, height: 600 }, - executablePath: '/usr/bin/chromium', - // executablePath: await chromium.executablePath(), + // executablePath: '/usr/bin/chromium', + executablePath: await chromium.executablePath(), headless: chromium.headless, ignoreHTTPSErrors: true, }); diff --git a/src/hooks/motherOfAllHooks.ts b/src/hooks/motherOfAllHooks.ts index 25a8cb5..8ff5ff0 100644 --- a/src/hooks/motherOfAllHooks.ts +++ b/src/hooks/motherOfAllHooks.ts @@ -52,7 +52,7 @@ const useMotherOfAllHooks = (params: UseIpAddressProps { // Something fucked up, log the error - updateLoadingJobs(jobId, 'error', err.message, reset); + updateLoadingJobs(jobId, 'error', err.error || err.message, reset); throw err; }) } diff --git a/src/pages/Results.tsx b/src/pages/Results.tsx index 7f5d383..25c8640 100644 --- a/src/pages/Results.tsx +++ b/src/pages/Results.tsx @@ -154,18 +154,11 @@ const Results = (): JSX.Element => { const parseJson = (response: Response): Promise => { return new Promise((resolve) => { - if (response.ok) { response.json() .then(data => resolve(data)) .catch(error => resolve( { error: `Failed to process response, likely due to Netlify's 10-sec limit on lambda functions. Error: ${error}`} )); - } else { - resolve( - { error: `Response returned with status: ${response.status} ${response.statusText}.` - + `This is likely due to an incompatibility with the lambda function.` } - ); - } }); };