Instance Method

assertNoFailure(_:file:line:)

Raises a fatal error when its upstream publisher fails, and otherwise republishes all received input.

Declaration

func assertNoFailure(_ prefix: String = "", file: StaticString = #file, line: UInt = #line) -> Publishers.AssertNoFailure<Self>

Parameters

prefix

A string used at the beginning of the fatal error message.

file

A filename used in the error message. This defaults to #file.

line

A line number used in the error message. This defaults to #line.

Return Value

A publisher that raises a fatal error when its upstream publisher fails.

Discussion

Use this function for internal sanity checks that are active during testing but do not impact performance of shipping code.

See Also

Handling Errors

func `catch`<P>((Self.Failure) -> P) -> Publishers.Catch<Self, P>

Handles errors from an upstream publisher by replacing it with another publisher.

func tryCatch<P>((Self.Failure) -> P) -> Publishers.TryCatch<Self, P>

Handles errors from an upstream publisher by replacing it with another publisher or an error.

func retry(Int) -> Publishers.Retry<Self>

Attempts to recreate a failed subscription with the upstream publisher using a specified number of attempts to establish the connection.