Add better catch if getting the right page in the HAR fails. (#3810)

This commit is contained in:
Peter Hedenskog 2023-04-08 20:15:16 +02:00 committed by GitHub
parent a84c59b714
commit 1efa38e966
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -267,7 +267,20 @@ export default class BrowsertimePlugin extends SitespeedioPlugin {
url
);
}
run.har = pickAPage(result.har, harIndex);
try {
run.har = pickAPage(result.har, harIndex);
} catch (harError) {
log.error('Couldnt get the right page for the HAR', harError);
super.sendMessage(
'error',
'Could not get the right page for the HAR, the page is missing',
{
url,
runIndex,
iteration: runIndex + 1
}
);
}
} else {
// If we do not have a HAR, use browser info from the result
if (result.length > 0) {