Nicer error messages

Richard Carlsson richardc@REDACTED
Mon Oct 31 13:04:52 CET 2005


Here is a smallish hack (attached diff) which improves the readability
of error messages in the Erlang shell. As an example:

  Eshell V5.5  (abort with ^G)
  1> 17 ++ [].

  =ERROR REPORT==== 31-Oct-2005::12:42:16 ===
  Error in process <0.30.0> with exit value:
{badarg,[{erlang,'++',[17,[]]},{erl_eval,eval_op,3},{erl_eval,expr,5},{shell,exprs,6},{shell,eval_loop,3}]}

  ** exited: badarg **
    in function erlang:'++'/2
      called as '++'(17,[])
    in call from erl_eval:eval_op/3
    in call from erl_eval:expr/5
    in call from shell:exprs/6
    in call from shell:eval_loop/3
  2>

(Note that the =ERROR REPORT=... part of the above is printed by the error
logger, not the shell, and is not affected by this hack.)

The OTP folks weren't too keen on including this, so I'm posting it here.
Let's see if you like it enough to make them change their mind.

	/Richard

----
 "Having users is like optimization: the wise course is to delay it."
   -- Paul Graham
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shell.diff
Type: text/x-patch
Size: 2318 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20051031/61c52a22/attachment.bin>


More information about the erlang-questions mailing list