Generic Instance Method




func `catch`<P>(_ handler: @escaping (Upstream.Failure) -> P) -> Publishers.Catch<Publishers.Share<Upstream>, P> where P : Publisher, Self.Output == P.Output




Return Value




enum SimpleError: Error { case error }
    if v < 5 {
        return v
    } else {
        throw SimpleError.error

let noErrorPublisher = errorPublisher.catch { _ in
    return Publishers.Just(100)
