-
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: Handle DOM.resolveNode errors #5427
core: Handle DOM.resolveNode errors #5427
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
CLAs look good, thanks! |
@paulirish |
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.
thanks @webcarrot this is a great start!
@@ -63,7 +63,8 @@ class Element { | |||
return null; | |||
} | |||
return this.driver.getObjectProperty(resp.object.objectId, propName); | |||
}); | |||
}) | |||
.catch(() => null); |
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.
FWIW I'm not sure we should fail silently here because the semantics end up being a bit weird (pretending the property doesn't exist when it's actually the element that doesn't). It seems like the caller should handle the exception (like it now does above in all-event-listeners).
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.
This is consistent with the current behavior of the method though, returning null
when the object does not exist. If we keep throwing here, we should convert the above to throw and change the typedef
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.
Ah, good point, I missed the first check. I wonder if we ever actually fail here then. The issue seems like it's been the event listener gatherer that's been failing. All good regardless.
Summary
Catch
DOM.resolveNode
errors.Related Issues/PRs
Issue: #2736