[erlang-questions] try/catch

David Mercer <>
Tue Jun 29 15:36:54 CEST 2010


On Monday, June 28, 2010, Wes James wrote:

> I also
> need to remember that an expression is more than just a single line of
> code but can be several lines separated by a "," in erlang.

I was previously unaware of that, myself.  I knew it could be done with the
"begin" and "end" keywords, but not without.  What, then, are the begin/end
keywords for?

Like Garrett, I usually use try...of to ensure I am catching errors only
where I expect them.  I don't like to catch errors.  In fact, I usually use
"try" for the "after" clause rather than the "catch"...

Cheers,

DBM



More information about the erlang-questions mailing list