Uh oh!
There was an error while loading. Please reload this page.
.NET: fix: Expose WorkflowErrorEvent as ErrorContent - #2762
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where workflows hosted using .AsAgent() were not exposing inner errors coming from exceptions through the WorkflowErrorEvent. The fix converts error events to ErrorContent objects so they can be properly surfaced to consumers.
Key Changes:
- Added an
Exceptionproperty toWorkflowErrorEventfor direct access to the underlying exception - Modified
WorkflowThread.CreateUpdateto accept a raw representation parameter - Added handling for
WorkflowErrorEventin workflow execution to convert exceptions toErrorContent
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| WorkflowErrorEvent.cs | Adds public Exception property to expose the underlying exception data |
| WorkflowThread.cs | Updates CreateUpdate signature to include raw representation and adds error event handling to convert exceptions to ErrorContent |
| WorkflowHostSmokeTests.cs | Adds comprehensive smoke tests validating both direct error content streaming and exception-to-error-content conversion |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
25ea844 to
e86f587Comparee86f587 to
fcd90d2CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
fcd90d2 to
a39ecc9Comparea39ecc9 to
0cee333Compare0cee333 to
7bb7356Compare7bb7356 to
4838b3aCompare
Motivation and Context
When hosted using
AsAgent(),Workflows were not exposing inner errors coming asExceptions (through raisedWorkflowErrorEvent)Description
The fix is to convert the
Messageproperty to anErrorContenton the way out, rather than rely on the default "empty update" to collect the raw event.Contribution Checklist
Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.