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

Add error detection when EmitEventAsync fails in internal RunAsync #6708

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

sw-joelmut
Copy link
Collaborator

#minor

Description

This PR adds error detection when the internal RunAsync method fails using AdaptiveDialogs, otherwise, the original Exception gets lost.

e.g.: original exception containing circular reference errors, it's captured by the dialogContext.EmitEventAsync to send the error as a message, then, it proceeds to fail, and the error thrown in the stack is the circular reference error, and the original exception gets lost.

Specific Changes

  • Added try/catch around the EmitEventAsync when used in the InternalRunAsync method. If there is an error, it will be captured and thrown as an AggregateException containing the original and new error.
  • Added unit test to validate this behavior.
  • Updated unit test failing with similar behavior.

Testing

The following image shows the pipeline working and how the error is thrown.
image
image

@sw-joelmut sw-joelmut added the Automation: No parity PR does not need to be applied to other languages. label Nov 22, 2023
@sw-joelmut sw-joelmut requested a review from a team as a code owner November 22, 2023 13:47
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 378002

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage remained the same at 78.438%

Files with Coverage Reduction New Missed Lines %
/libraries/AdaptiveExpressions/BuiltinFunctions/GetNextViableTime.cs 1 90.91%
/libraries/AdaptiveExpressions/BuiltinFunctions/GetPreviousViableTime.cs 1 90.91%
/libraries/Microsoft.Bot.Builder.Dialogs/DialogExtensions.cs 4 94.74%
Totals Coverage Status
Change from base Build 377857: 0.0%
Covered Lines: 26127
Relevant Lines: 33309

💛 - Coveralls

@BruceHaley
Copy link
Contributor

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll

@tracyboehrer tracyboehrer merged commit 9d80765 into main Nov 22, 2023
15 of 16 checks passed
@tracyboehrer tracyboehrer deleted the southworks/add/runasync-error-handler branch November 22, 2023 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation: No parity PR does not need to be applied to other languages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants