Effect CommunityEC
Effect Community2y ago
178 replies
addamsson

Difference between `Effect.fail` and `Effect.die` and when to use each

I'm looking at the difference between Effect.fail and Effect.die and if I understand this correctly then the only difference is that die returns an effect that has never in its left parameter as opposed to fail which has the error type there? So in short I should use die when the error is non-recoverable? I checked the result with runPromiseExit and I can see that it differentiates between failure and a defect ... will this make a difference if I'm aggregating errors? What I'm curious about is whether this is just a semantic difference, or will it affect other functionality provided by effect?
Was this page helpful?