2 ms·
Wow, I used Erlang extensively a few years ago and don't remember exceptions at all. (Exit reasons and process monitors, yes; but I don't think I ever wrote a
by colanderman 8y ago
Wow, I used Erlang extensively a few years ago and don't remember exceptions at all. (Exit reasons and process monitors, yes; but I don't think I ever wrote a "catch" expression, or encountered a library that expected me to do so.)
- masklinn 8y agoYeah it's very rare to catch exception within processes, or to raise them explicitly. It's common to write something like {ok, Result} = foo() though, and that raises badmatch if it fails, and you handle it in a supervisor.
- rs86 8y agoYou can use throw/catch to great effect when you need non local returns