Skip to content

.Net Processes - Add Process-Level Error Handler - #9477

Merged
Chris (crickman) merged 15 commits into
mainfrom
process-global-errorhandler
Oct 31, 2024
Merged

Chris (crickman) merged 15 commits into
mainfrom
process-global-errorhandler

Conversation

@crickman

@crickman Chris (crickman) commented Oct 30, 2024 •

Copy link
Copy Markdown
Contributor

Motivation and Context

Enabled support for function-specific error-handler step in this PR: #9187

Fixes: #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

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):
image

Contribution Checklist

@crickman Chris (crickman) added PR: in progress Under development and/or addressing feedback .NET Issue or Pull requests regarding .NET code experimental Associated with an experimental feature enhancement processes labels Oct 30, 2024
@crickman Chris (crickman) self-assigned this Oct 30, 2024
@crickman
Chris (crickman) requested a review from a team as a code owner October 30, 2024 18:50
@crickman Chris (crickman) added PR: ready for review All feedback addressed, ready for reviews and removed PR: in progress Under development and/or addressing feedback labels Oct 31, 2024
@crickman
Chris (crickman) added this pull request to the merge queue Oct 31, 2024
Merged via the queue into main with commit 5ac8460 Oct 31, 2024
@crickman
Chris (crickman) deleted the process-global-errorhandler branch October 31, 2024 21:43

This branch was previously deployed

1 inactive deployment
integration — 9e917e96 Deployed Oct 31, 2024 by crickman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement experimental Associated with an experimental feature .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews processes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

.Net Processes - Support process scoped error handler

3 participants