SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

WIP: Fix #2100: BindingException incorrectly wrapping ArgumentException when using an async step

Open mdalepiane opened this issue 5 years ago • 0 comments

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:

  1. Create unit tests to replace the test scenarios defined in Async Exception.feature;
  2. Apply this fix to the other AsyncHelpers.RunSync method;

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.

mdalepiane avatar Feb 22 '21 02:02 mdalepiane