3 ms·
Lol, have you never gotten an exception that wraps another exception in the error payload. Those are not fun to parse. I've also run into situations where the
by throwawaymaths 3y ago
Lol, have you never gotten an exception that wraps another exception in the error payload. Those are not fun to parse. I've also run into situations where the error reporting agent trims the error. Murphys law, always exactly a few bytes before the part you needed. Or, the key information is shortened by default limits on inspect or #SomeStruct<... Oops sorry I hid it>
Anyways. The whole point of BEAM is that you code the happy path and if you can't actually do anything about the error, you're wasting effort and making your code harder to reason about.
Nobody is suggesting using errors like control flow. Writing a try/rescue is indeed an antipattern. It's like the Toyota factory line. If something irrecoverable happens, just pull the emergency stop and start over.
If you've been handling errors like that since 2016, well, I guess that's your choice, man. I wouldn't do it.