[erlang-questions] Line number in errors: badmatch, case clause, badarith
Tue Jan 12 15:30:00 CET 2010
It works with this type of error too?
** exception error: no function clause matching test:bar(1)
4 foo() ->
7 bar(0) -> 0.
There is a way to get what line (5) the error occurred?
On Tue, Jan 12, 2010 at 10:11 AM, Thomas Lindgren
> ----- Original Message ----
> > From: Max Lapshin <max.lapshin@REDACTED>
> > To: Erlang-Questions Questions <erlang-questions@REDACTED>
> > Sent: Tue, January 12, 2010 8:16:42 AM
> > Subject: [erlang-questions] Line number in errors: badmatch, case clause, badarith
> > Is it hard to change format of runtime errors to include line number,
> > where error appeared.
> > I understand, that it is impossible to understand, on which line
> > function arguments hasn't matched,
> > but it is clearly determined, on which line badmatch or badarith has happened.
> > Are there hidden problems with such error information?
> I think the compiler should add such info to exceptions, but it hasn't happened yet. In the meantime, you could try this: git://github.com/thomasl/smart_exceptions.git
> (The "devel" version seems to work fairly well, but no promises.)
> PS. Given that OTP has taken the fantastic step of using github, maybe I ought to submit that patch myself?
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
More information about the erlang-questions