Use try...catch, erlang:error/1, and erlang:get_stacktrace(). They have all been supported for ages, so there is no reason to use an old-fashioned catch.