[erlang-questions] Displaying the line number when error occured

Thomas Lindgren thomasl_erlang@REDACTED
Mon May 21 09:59:05 CEST 2007


--- Dominic Williams <xpdoka@REDACTED>
wrote:

> Otherwise, there is a tool called smart_exceptions
> in jungerl, which
> is a parse transform that does what you want.

Do note that, while I (the author) use
smart_exceptions routinely for my development, it is
not quite a complete solution. It has trouble with
some erlang constructs, and gives spurious warnings in
some cases. (The root cause is that exported variables
are a pain.)

Alternatives: the macro ?LINE can be used in simple
situations, and there is also the various trace
facilities, such as dbg as well as more advanced
tools, to help with seeing where and why a fault
arose. There is also the graphical debugger (which I
don't use).

As usual, I'll close by saying a compiler-based
solution would be preferrable to smart_exceptions, but
there isn't one yet.

Best,
Thomas



       
____________________________________________________________________________________Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz



More information about the erlang-questions mailing list