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

fix(waitForFunction): handle predicate that throws #2488

Merged
merged 1 commit into from
Jun 8, 2020
Merged

fix(waitForFunction): handle predicate that throws #2488

merged 1 commit into from
Jun 8, 2020

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Jun 5, 2020

Currently, we fail when the predicate throws on the first call, and timeout when it fails on any other call.

There are two possible ways to handle throwing predicates:

  • Fail waitForFunction if predicate throws once. This gives you the error faster.
  • Tolerate predicate exceptions. You do not have to worry about non-initialized state during page load.

This change implements the first way.

Currently, we fail when the predicate throws on the first call,
and timeout when it fails on any other call.

There are two possible ways to handle throwing predicates:
- Fail waitForFunction if predicate throws once. This is good
  since it gives you the error faster.
- Tolerate predicate exceptions. This is good because you do
  not have to worry about non-initialized state during load.

This change implements the former.
@dgozman dgozman merged commit 55cfff3 into microsoft:master Jun 8, 2020
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.

2 participants