On Sun, Dec 5, 2010 at 6:06 AM, <jan@apache.org> wrote:
> + case catch Fun(Doc, Req) of
> + true -> true;
> + false -> false;
> + {'EXIT', Error} -> ?LOG_ERROR("~p", [Error])
> + end
The O'Reilly book _Erlang Programming_ suggests that catch expressions
(the older form before try...catch came out) are not as elegant as
try...catch.
http://books.google.com/books?id=Qr_WuvfTSpEC&pg=PA74&lpg=PA74&source=bl&ots=aK-DfyxREb&sig=LA1Fi-lSKEPJNvMFdp0kXzOxDg8&hl=en&ei=W0T7TJLpMY_QrQffr4HBCA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBIQ6AEwAA#v=onepage&q&f=false
Also Joe Armstrong's book states that you lose a lot of precision
analyzing the cause of an error.
FYI.
--
Jason Smith
CouchOne Hosting
|