Skip to content

Added information on custom error handlers. #724

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ RetryInterval: '00:10:00'

## Global Error handling

The WorkflowHost service also has a `.OnStepError` event which can be used to intercept exceptions from workflow steps on a more global level.
The WorkflowHost service also has a `.OnStepError` event which can be used to intercept exceptions from workflow steps on a more global level.

## Custom Error Handlers
Copy link
Owner

Choose a reason for hiding this comment

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

This is really an internal mechanism for handling error types, I suppose you could modify or extend it by registering other handlers in the IoC container, as you can do with any internal workflow-core service... however, I don't think this description really captures that or gives good examples on how to do it. Maybe a better approach would be to write a doc on how to replace internal workflow-core services via IoC registration? We could also add a reference to the new middleware feature on the error handling page?

Copy link
Author

@dimademi dimademi Dec 15, 2020

Choose a reason for hiding this comment

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

That's a good idea, I can open a new doc page for internal services that will, over time, contain all services documentation.
As for the middleware feature documentation - we can paste the detailed explanation you wrote here into the docs

All `IWorkflowErrorHandler` are registered when `.AddWorkflow()` is called.
To create a custom error handler implement `IWorkflowErrorHandler` and add it as `Transient`.

Each `IWorkflowErrorHandler` should specify `WorkflowErrorHandling` which suggests what type of errors it should handle.