Generic Instance Method


Changes the failure type declared by the upstream publisher.


func setFailureType<E>(to failureType: E.Type) -> Publishers.SetFailureType<Publishers.Share<Upstream>, E> where E : Error
Available when Failure is Never.



The Failure type presented by this publisher.

Return Value

A publisher that appears to send the specified failure type.


The publisher returned by this method cannot actually fail with the specified type and instead just finishes normally. Instead, you use this method when you need to match the error types of two mismatched publishers.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software