Not possible to run click() in a try catch
- Dominant language
- JavaScript
- Stars
- 441
- Forks
- 254
- PR merge metrics
- No merged PRs in 30d
Description
If you have a click handler that throws an exception there's no way to capture this:
``` js
try {
syn.click(element);
} catch(err) {
// handle the error
}
```
It is because a setTimeout is used because of an IE bug: https://github.com/bitovi/syn/blob/master/src/synthetic.js#L811
Perhaps there should be an option `catchExceptions` that catches them and calls the callback with an error object.
Contributor guide
Research direction
Read src/synthetic.js around line 811 to understand the setTimeout workaround for the IE bug. Trace syn.click(element)'s callback path and determine how the proposed catchExceptions option should report handler exceptions; done means the callback receives an error object while existing click behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100