Skip to content

Commit 0e3da2b

Browse files
committed
Added some missing codes.
1 parent 371d057 commit 0e3da2b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lib/browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export async function newPage(poolResource) {
244244

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

250250
// Create a page

lib/cache.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ export const fetchAndProcessScript = async (
140140

141141
if (shouldThrowError) {
142142
throw new ExportError(
143-
`Could not fetch the ${script}.js. The script might not exist in the requested version (status code: ${response.statusCode}).`
143+
`Could not fetch the ${script}.js. The script might not exist in the requested version (status code: ${response.statusCode}).`,
144+
500
144145
).setError(response);
145146
} else {
146147
log(
@@ -186,9 +187,10 @@ export const fetchScripts = async (
186187
port: proxyPort
187188
});
188189
} catch (error) {
189-
throw new ExportError('[cache] Could not create a Proxy Agent.').setError(
190-
error
191-
);
190+
throw new ExportError(
191+
'[cache] Could not create a Proxy Agent.',
192+
500
193+
).setError(error);
192194
}
193195
}
194196

@@ -270,7 +272,8 @@ export const updateCache = async (
270272
return fetchedModules;
271273
} catch (error) {
272274
throw new ExportError(
273-
'[cache] Unable to update the local Highcharts cache.'
275+
'[cache] Unable to update the local Highcharts cache.',
276+
500
274277
).setError(error);
275278
}
276279
};

0 commit comments

Comments
 (0)