Class TryCatchProcessor

Assembly: redb.Route.dll

Try-catch error handling processor. Wraps a body processor and catches
exceptions using ordered catch clauses. Optionally runs a finally block.

public class TryCatchProcessor : IProcessor

Inheritance

Object→TryCatchProcessor

Implements

Properties

CatchClauses

Gets the catch clauses.

public IReadOnlyList<CatchClause> CatchClauses { get; }

Finally

Gets the finally processor.

public IProcessor? Finally { get; }

Methods

Catch(CatchClause)

Adds a catch clause.

public TryCatchProcessor Catch(CatchClause clause)

Catch<TException>(IProcessor)

Adds a typed catch clause.

public TryCatchProcessor Catch<TException>(IProcessor handler) where TException : Exception

Process(IExchange, CancellationToken)

Processes the exchange asynchronously.

public Task Process(IExchange exchange, CancellationToken ct = default)

SetFinally(IProcessor)

Sets the finally processor.

public TryCatchProcessor SetFinally(IProcessor processor)

Constructors

TryCatchProcessor(IProcessor, ILogger?)

Creates a try-catch processor wrapping the specified body.