[erlang-questions] is this try expression idiom common?

mats cronqvist <>
Tue Nov 11 22:54:44 CET 2008


"Kevin" <> writes:


> I guess this creative formatting of
>
> try a(), b(), c()
> catch
> throw:_ -> something_failed
> end.
>
>
> To me this is a completely different idiom, absolutely nothing like a 
> case expression, and opens erlang up to a more exception based control 
> flow and error handling. Is this legit? Frowned upon? I searched the 
> pragmatic book and there is not a single example of this.

  i do this all the time;

try a(),b(),c()
catch _:R -> oops(R)
end.

  excellent style, imo :>

  mats



More information about the erlang-questions mailing list