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 for SF2649: Aggregate exceptions lost from async step definitions #2667

Conversation

clrudolphi
Copy link
Contributor

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)
  • [X ] I have added an entry to the changelog. (mandatory)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

…reserveStackTrace' replaced with call to ExceptionDispatchInfo.Capture.

BindingInvoker unit tests added to validate handling of various combinations of exceptions thrown from sync and async StepDefinition methods.
…. BindingInvoker changed to pass AggregateExceptions through. Use of 'PreserveStackTrace' replaced with call to ExceptionDispatchInfo.Capture.

BindingInvoker unit tests added to validate handling of various combinations of exceptions thrown from sync and async StepDefinition methods.
TestExecutionEngine updated to also use ExceptionDispatchInfo.Capture().Throw() in order to preserve the stack trace of user-hook's exception.
Copy link
Contributor

@gasparnagy gasparnagy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with it!

@gasparnagy gasparnagy merged commit 86c029d into SpecFlowOSS:master Nov 2, 2022
gasparnagy added a commit that referenced this pull request Nov 9, 2022
* master:
  Report binding problems to binding registry and show them as errors during test execution (#2663)
  Fix for SF2649: Aggregate exceptions lost from async step definitions (#2667)

# Conflicts:
#	TechTalk.SpecFlow/Bindings/BindingInvoker.cs
#	Tests/TechTalk.SpecFlow.RuntimeTests/Bindings/BindingInvokerTests.cs
Code-Grump pushed a commit to Code-Grump/SpecFlow that referenced this pull request Mar 29, 2023
…SpecFlowOSS#2667)

* BindingInvoker changed to pass AggregateExceptions through. Use of 'PreserveStackTrace' replaced with call to ExceptionDispatchInfo.Capture.
BindingInvoker unit tests added to validate handling of various combinations of exceptions thrown from sync and async StepDefinition methods.

* BindingInvoker now passes AggregateExceptions along up the call chain. BindingInvoker changed to pass AggregateExceptions through. Use of 'PreserveStackTrace' replaced with call to ExceptionDispatchInfo.Capture.
BindingInvoker unit tests added to validate handling of various combinations of exceptions thrown from sync and async StepDefinition methods.
TestExecutionEngine updated to also use ExceptionDispatchInfo.Capture().Throw() in order to preserve the stack trace of user-hook's exception.
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