-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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(gather): define new DNS failure LH Error #6579
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing functional about this other than we're explaining what ERR_NAME_NOT_RESOLVED
means to the user now, right?
@@ -182,6 +182,13 @@ const ERRORS = { | |||
lhrRuntimeError: true, | |||
}, | |||
|
|||
// Protocol timeout failures | |||
DNS_FAILURE: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proto update :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM excited to get more visibility on this. Need proto change to add new LH Error. May need future PR to test this code also in gather-runner-test.
ptal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits
proto/lighthouse-result.proto
Outdated
@@ -49,6 +49,8 @@ enum LighthouseError { | |||
PROTOCOL_TIMEOUT = 17; | |||
// Used when the page is not responding after maxWaitForLoad. | |||
PAGE_HUNG = 18; | |||
// DNS timed out for the main document request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handles more cases than just a timeout?
// https://cs.chromium.org/chromium/src/net/base/net_error_list.h?rcl=cd62979b | ||
if ( | ||
netErr.startsWith('net::ERR_NAME_NOT_RESOLVED') || | ||
netErr.startsWith('net::ERR_NAME_RESOLUTION_FAILED') || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just test equality for these two? Or are these expected as prefixes?
netErr.startsWith('net::ERR_DNS_') | ||
) { | ||
errorDef = {...LHError.errors.DNS_FAILURE}; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these conditionals are multiplying in an unseemly fashion. Maybe #6457 can take on cleaning them up with early returns @exterkamp
netErr.startsWith('net::ERR_NAME_RESOLUTION_FAILED') || | ||
netErr.startsWith('net::ERR_DNS_') | ||
) { | ||
errorDef = {...LHError.errors.DNS_FAILURE}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if no string/message altering, no need to object spread to get a copy (e.g. see NO_DOCUMENT_REQUEST
above)
// Wrap gatherer response in promise, whether rejected or not. | ||
Promise.resolve().then(_ => gatherer.afterPass(passContext, passData)); | ||
const artifactPromise = pageLoadError | ||
? Promise.reject(pageLoadError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did prettier get loose? This is bad (I'm surprised we don't lint it) and the concat thing above is definitely worse :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier! get back in your cage.
Seeing a lot of these errors. I think we want to expose them to the user individually.