SAIF.NetCore.ErrorHandler operations and processes¶
This page catalogs every operation this library performs and links to a detail page for each.
Operations catalog¶
| ID | Operation | Owner | Trigger |
|---|---|---|---|
| OP-01 | Log an exception and write the HTTP error response | ErrorHandler.LogAndReturnException |
DynamicErrorHandler (current hosts) or OP-02 (legacy hosts) after catching an exception |
| OP-02 | Legacy conventional middleware | ErrorHandler.Invoke ([Obsolete]) |
app.UseMiddleware<ErrorHandler>() in pre-v1.2.X hosts |
| OP-03 | Handle a Windows Service error | WindowsServiceErrorHandler.HandleError |
ServiceWorker.HandleTaskError after a task throws, or direct consumer call |
| OP-04 | Execute a special error action | SpecialErrorAction.Invoke / SpecialErrorAction<T>.Invoke |
OP-03 step 4 |
| OP-05 | Format a Windows Service error | WindowsServiceError.ID / GetFormattedErrorString |
OP-03 step 3, and read by special actions through IErrorContextContainer.ErrorContent |
| OP-06 | Exception utilities | ExceptionExtensions |
OP-03 steps 1 and 2 |
| OP-07 | Pass error context to actions | ContextContainer |
BeginErrorHandling subscribers (OP-03 step 2) and special actions (OP-04 step 3) |
Process flow¶
flowchart TD
A["HTTP host: DynamicErrorHandler catches exception"] -->|OP-01| B[ErrorHandler.LogAndReturnException]
A2["Legacy HTTP host: ErrorHandler.Invoke"] -->|OP-02| B
C["Windows Service: ServiceWorker.HandleTaskError"] -->|OP-03| D[WindowsServiceErrorHandler.HandleError]
D -->|OP-05| E[WindowsServiceError formatting]
D -->|OP-06| F[ExceptionExtensions stack trace / log details]
D -->|OP-04| G[SpecialErrorAction.Invoke]
D -->|OP-07| H[ContextContainer]
G -->|reads| H
Related documentation¶
Sources¶
src/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/ErrorHandler.cssrc/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/ExceptionExtensions.cssrc/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/WindowsService/WindowsServiceErrorHandler.cssrc/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/WindowsService/SpecialErrorAction.cssrc/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/WindowsService/WindowsServiceError.cssrc/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/SAIF.NetCore.ErrorHandler/WindowsService/ContextContainer.cs