You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5ac8460
Browse filesBrowse the repository at this point in the historyBrowse files
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Enabled support for function-specific error-handler step in this PR:
#9187Fixes: #9291
This change provides the ability to define a _process scoped_ error
handler (as opposed to function specific).
When a function-scoped error-handler is defined, it will take
precedence.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
```c#
ProcessBuilder process = new(nameof(ProcessFunctionErrorHandledAsync));
ProcessStepBuilder errorStep = process.AddStepFromType<ErrorStep>();
process.OnError().SendEventTo(new ProcessFunctionTargetBuilder(errorStep));
class ErrorStep : KernelProcessStep
{
[KernelFunction]
public void GlobalErrorHandler(Exception exception) { }
}
```
**Notes:**
- Switch error handler from passing `Exception` object to a
`KernelProcessError` to satisfy serialization expectations
- Normalized namespaces for `Internal` shared code
- Introduced shared `ProcessConstants` file
- Opportunistically converted some `List` creation to `Array`
- Opportunistically included parameter name in some `Verify` assertions.
- Opportunistically removed a extraneous _not-null_ directives (`!`)
- Verified DAPR error handling in demo app (`True` means the expected
error handler was invoked):
<img width="449" alt="image"
src="https://github.com/user-attachments/assets/2d987378-edd2-4c9f-92dd-cf112888b8b0">
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
0 commit comments