ZIO<R, E, A>.fromNullableOrFail constructor

ZIO<R, E, A>.fromNullableOrFail(
  1. A? a,
  2. E onNull()
)

Create a EIO from the given nullable value, succeeding when it is not null, and failing with the result of onNull when it is null.

Implementation

factory ZIO.fromNullableOrFail(A? a, E Function() onNull) =>
    ZIO.fromOptionOrFail(Option.fromNullable(a), onNull);