orError

inline fun <R> AsyncResult<R?>.orError(noinline lazyMetadata: () -> Any?? = null): AsyncResult<R>

Transforms the type of AsyncResult from nullable to non-nullable. If the value is null, it will return an Error. It also allows adding specific metadata to disambiguate errors if necessary, via lazyMetadata.