Contents

Publishers.TryCatch

A publisher that handles errors from an upstream publisher by replacing the failed publisher with another publisher or producing a new error.

Declaration

struct TryCatch<Upstream, NewPublisher> where Upstream : Publisher, NewPublisher : Publisher, Upstream.Output == NewPublisher.Output

Overview

Because this publisher’s handler can throw an error, Publishers.TryCatch defines its Failure type as Error. This is different from Publishers.Catch, which gets its failure type from the replacement publisher.

Topics

Creating a try-catch publisher

Declaring supporting types

Inspecting publisher properties

See Also

Handling errors