asSingleOrError

fun <T> Maybe<T>.asSingleOrError(error: Throwable = NoSuchElementException()): Single<T>

Converts this Maybe into a Single, which signals a success value via onSuccess (if this Maybe succeeds) or error via onError (if this Maybe completes).

Please refer to the corresponding RxJava document.


fun <T> Maybe<T>.asSingleOrError(errorSupplier: () -> Throwable): Single<T>

Converts this Maybe into a Single, which signals a success value via onSuccess (if this Maybe succeeds) or a Throwable returned by errorSupplier via onError (if this Maybe completes).

Please refer to the corresponding RxJava document.