Class RouteCancellation

Namespace: redb.Route.Core
Assembly: redb.Route.dll

The one rule that tells a cancellation from a failure, and the one place an owned timeout is named as
one. Shared by error handling and by every component that runs under a deadline.

A cancellation is what the caller's asked for. An
raised while that token is still live is NOT a cancellation: it
is a timeout (an HttpClient deadline, a component's own guard) or an internal abort, and error handling
must see it like any other failure. Keying the pass-through on the exception type alone was the bug: an
HTTP producer's timeout is a , so TryCatch/Catch, OnException, Retry
and DeadLetterChannel all treated it as cancellation and skipped it, and the exchange died whole.


Error handling normalizes such an exception to (the original kept as
) so a route can name it — Catch<TimeoutException>,
OnException<TimeoutException>, <catch exceptions="System.TimeoutException"> —
instead of the symptom type . A genuine cancellation is never
normalized and never handled.

public static class RouteCancellation

Inheritance

Object→RouteCancellation

Methods

IsCancellation(Exception, CancellationToken)

True when the exception is the cancellation ct asked for. Everything else —

public static bool IsCancellation(Exception ex, CancellationToken ct)

IsCancellationType(Type)

True when exceptionType is or a subtype

public static bool IsCancellationType(Type exceptionType)

IsOwnedTimeout(Exception, CancellationToken)

True when the exception is an that is NOT the caller's

public static bool IsOwnedTimeout(Exception ex, CancellationToken ct)

Normalize(Exception, CancellationToken, string?)

Names an owned timeout as one for error handling: an raised

public static Exception Normalize(Exception ex, CancellationToken ct, string? message = null)