tryCatchOption<A> static method

IOOption<A> tryCatchOption<A>(
  1. FutureOr<A> f()
)

A variant of ZIO.tryCatch, that returns an IOOption instead of an EIO.

Failures are mapped to None.

Implementation

static IOOption<A> tryCatchOption<A>(
  FutureOr<A> Function() f,
) =>
    ZIO.tryCatch(f, (_, s) => const None());