Skip to content

Commit

Permalink
Part 1 of a better error message when measure without navigating
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Oct 13, 2023
1 parent dc2d51f commit e4398c2
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions lib/plugins/browsertime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,30 @@ export default class BrowsertimePlugin extends SitespeedioPlugin {
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',
{
if (message.type === 'browsertime.navigationScripts') {
const message =
'There are pages that misses data. This is in almost all cases caused by that you try to measure a page view but you do not navigate to a new page.';
log.error(message, harError);
super.sendMessage('error', message, {
url,
runIndex,
iteration: runIndex + 1
}
);
});
} else {
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
Expand Down

0 comments on commit e4398c2

Please sign in to comment.