Effect CommunityEC
Effect Community2mo ago
6 replies
Brave Sir Robin

Whats the best way of converting an option to a failure?

A library (Confect) is returning Option<DatabaseGetResult>. I would like to convert that to a failure.

Obviously I could do if (Option.none(result)) { return Effect.fail(...) } but there's already a Option.getOrThrow and I guess I don't understand why there's not a Option.getOrFail? Is there a reason for this?
Was this page helpful?