[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Uninformative error message
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 17 Oct 2014 16:13:49 -0300
> I have a program with many instances of
>
> error(msg)
>
> where msg is each time some expression.
> If this expression evaluates to a non-string,
> the error message is merely
>
> lua: (error object is not a string)
>
> There are obviously plenty of easy workarounds,
> but is there some deep reason why the traceback
> is omitted?
The traceback is not added to the final message (when it is being
printed), but to the error object itself (among other reasons because
the traceback is created before the error is actually raised, while the
stack is still alive). When the error object is not a string, it seems
tricky to append a traceback into it.
-- Roberto