Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: smooth rough edges of pageLoadError display and reporting #6083

Merged
merged 2 commits into from
Sep 22, 2018

Conversation

brendankenny
Copy link
Member

fixes #6071

  • runtimeWarnings and runtimeError both use the same message for page load errors
  • no longer throw on > 50% of audits failing (top level runtimeError and individual audit errors now take care of warning the user in that case)
  • Show error friendlyMessage in HTML report's warning box (runWarnings)

screen shot 2018-09-20 at 15 33 18

bonus: no longer have a big red GatherRunner:error FAILED_DOCUMENT_REQUEST error log on the pageLoadError we expect in the offline pass when a page doesn't support offline :) @exterkamp

@devtools-bot

This comment has been minimized.

@brendankenny
Copy link
Member Author

brendankenny commented Sep 20, 2018

I will fight you, devtools-bot

@brendankenny brendankenny reopened this Sep 20, 2018
@exterkamp
Copy link
Member

Love it. No more red text.

@@ -301,9 +301,7 @@ class Runner {
static getArtifactRuntimeError(artifacts) {
for (const possibleErrorArtifact of Object.values(artifacts)) {
if (possibleErrorArtifact instanceof LHError && possibleErrorArtifact.lhrRuntimeError) {
const errorMessage = possibleErrorArtifact.friendlyMessage ?
`${possibleErrorArtifact.friendlyMessage} (${possibleErrorArtifact.message})` :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this concatenation is now directly handled by gather runner now, right? was that the only case we fell into this path?

Copy link
Member Author

@brendankenny brendankenny Sep 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, in gather runner. And since this was only introduced in #6051, there's nothing depending on it (only lr uses it, and only for human debugging; it's never shown to users).

message here is the error code, so it seemed redundant to keep it when the code is sitting right next to it on the object. I can add it back if we want to match the other place(s?) we put together an error string out of an lherror

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, sounds good as-is 👍

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lurve it

} else if (mainRecord.failed) {
errorCode = LHError.errors.FAILED_DOCUMENT_REQUEST;
errorReason = mainRecord.localizedFailDescription;
errorDef = {...LHError.errors.FAILED_DOCUMENT_REQUEST};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why so fancy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why so fancy?

easier than Object.assign()? Dunno :) Just needed a shallow copy so it's not modifying the original message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runtimeError: even more useful
5 participants