Effect CommunityEC
Effect Community3y ago
3 replies
Arne

Handling Errors in Layer Creation

Is it an antipattern if the creation of a layer fails?

E.g. creating a MongoDb context can fail at least two reasons, ConfigError and MongoConnectionError so the layer could be Layer.Layer<never, ConfigError|MongoConnectionError, MongoDb>

But it would be better to have Layer.Layer<never, never, MongoDb>?.

Should the errors be handled elsewhere?
Was this page helpful?