3 ms·
> We find the bug in appsignal, build another arity match and go on with our day. Failing (as crashing is now termed ;) immediately when the data didn't match
by toast0 4y ago
> We find the bug in appsignal, build another arity match and go on with our day.
Failing (as crashing is now termed ;) immediately when the data didn't match the pattern is exactly the let it fail approach. If the data doesn't meet the expectations, there's nothing to do but crash. Maybe you've got a nice supervision tree, maybe not, but crashing immediately where things didn't match expectations usually gives you the right place to start looking; maybe it was some reasonable data, so you just handle it. Maybe it is unreasonable, so you need to look at where it came from, but usually (not always, of course) you just got the data and are pattern matching it, so you know where it came from too.