throwIfError

Throws an exception if the event result is of type StandardEventResult.Error. Otherwise, returns the event result unchanged.

e.g.

flow.throwIfError()
.catch { e -> ... } // 抛出后即可在此处捕获到
.collect { ... }

Return

A Flow that emits event results without errors.