Generating a random boolean and handling exceptions in TypeScript - Effect Community