ExceptionMappingBehavior Class

Definition

Translates an exception from the rest of the pipeline.

public sealed class ExceptionMappingBehavior : IStuntBehavior

Remarks

The behavior observes the call through Proceed. A synchronous failure is thrown by the stunt. A faulted or stays a fault of the returned awaitable, and Exception stays null.

The map receives that exception. A null result leaves the exception unchanged. Any other instance replaces it. A replacement that wraps the original keeps that original as its .

Pass swallow: true to let a null result complete the call with the value from DefaultValueProvider. The switch defaults to off, so a null result cannot turn a failure into a value. Pass the provider already used to register custom defaults, or omit it to use a new one. Native AOT uses the typed factories the stunt already registers.

Behaviors added before this one sit outside the translated call. Exceptions they throw are left alone.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Constructors (1)

Methods (2)