/** * Retrieve the first checked error on the `Left` if available, if there are * no checked errors return the rest of the `Cause` that is known to contain * only `Die` or `Interrupt` causes. * * @tsplus getter effect/core/io/Cause failureOrCause */ export function failureOrCause(self: Cause): Either> { return self.failureMaybe.fold( () => Either.right(self as Cause), // no E inside this cause, can safely cast Either.left ) }