SpecFlow
SpecFlow copied to clipboard
WIP: Fix #2100: BindingException incorrectly wrapping ArgumentException when using an async step
This pull requests fixes #2100.
Change AsyncHelpers.RunSync exception handling to throw a TargetInvocationException when an exception is thrown while executing the async task. This way exceptions thrown by synchronous and asynchronous executions are the same and can be handled by the same code.
Disclaimer: This is just a proposal. If this fix is reasonable I plan to:
- Create unit tests to replace the test scenarios defined in
Async Exception.feature; - Apply this fix to the other
AsyncHelpers.RunSyncmethod;
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue).
- [ ] New feature (non-breaking change which adds functionality).
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected).
- [ ] Performance improvement
- [ ] Refactoring (so no functional change)
- [ ] Other (docs, build config, etc)
Checklist:
- [x] I've added tests for my code. (most of the time mandatory)
- [ ] I have added an entry to the changelog. (mandatory)
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.