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<Publishers.TryLastWhere<Upstream>>

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.