Skip to content

IProgressReporterErrorHandler

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Progress

IProgressReporterErrorHandler Interface

Receives callbacks when an IProgressSink throws while handling an event. Without a handler, sink exceptions would be silently swallowed.

public interface IProgressReporterErrorHandler

Remarks

Implementations must be fast and must not throw — they run on the reporter's delivery path (synchronous or channel consumer). Throwing from the handler is undefined behavior and may tear down the consumer loop.

Register a custom implementation in DI to replace the default no-op handler. Typical implementations forward to ILogger, Application Insights, or an in-process diagnostic bus.

Methods

IProgressReporterErrorHandler.OnSinkException(IProgressSink, IProgressEvent, Exception) Method

Called when sink fails to process progressEvent.

void OnSinkException(NexusLabs.Needlr.AgentFramework.Progress.IProgressSink sink, NexusLabs.Needlr.AgentFramework.Progress.IProgressEvent progressEvent, System.Exception exception);

Parameters

sink IProgressSink

The sink that threw.

progressEvent IProgressEvent

The event that could not be delivered.

exception System.Exception

The exception thrown by the sink (already unwrapped from System.AggregateException where applicable).