Skip to content

Commit

Permalink
Added some missing codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulDalek committed Oct 29, 2024
1 parent 371d057 commit 0e3da2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export async function newPage(poolResource) {

// Throw an error in case of no connected browser
if (!browser || !browser.connected) {
throw new ExportError(`[browser] Browser is not yet connected.`, 400);
throw new ExportError(`[browser] Browser is not yet connected.`, 500);
}

// Create a page
Expand Down
13 changes: 8 additions & 5 deletions lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export const fetchAndProcessScript = async (

if (shouldThrowError) {
throw new ExportError(
`Could not fetch the ${script}.js. The script might not exist in the requested version (status code: ${response.statusCode}).`
`Could not fetch the ${script}.js. The script might not exist in the requested version (status code: ${response.statusCode}).`,
500
).setError(response);
} else {
log(
Expand Down Expand Up @@ -186,9 +187,10 @@ export const fetchScripts = async (
port: proxyPort
});
} catch (error) {
throw new ExportError('[cache] Could not create a Proxy Agent.').setError(
error
);
throw new ExportError(
'[cache] Could not create a Proxy Agent.',
500
).setError(error);
}
}

Expand Down Expand Up @@ -270,7 +272,8 @@ export const updateCache = async (
return fetchedModules;
} catch (error) {
throw new ExportError(
'[cache] Unable to update the local Highcharts cache.'
'[cache] Unable to update the local Highcharts cache.',
500
).setError(error);
}
};
Expand Down

0 comments on commit 0e3da2b

Please sign in to comment.