Initializer

init(upstream:handler:)

Creates a publisher that handles errors from an upstream publisher by replacing the failed publisher with another publisher.

Declaration

init(upstream: Upstream, handler: @escaping (Upstream.Failure) -> NewPublisher)

Parameters

upstream

The publisher that this publisher receives elements from.

handler

A closure that accepts the upstream failure as input and returns a publisher to replace the upstream publisher.