[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua 5.2 beta & error level
- From: Mike Pall <mikelu-1111@...>
- Date: Thu, 3 Nov 2011 17:30:08 +0100
Ashwin Hirschi wrote:
> The very first line correctly identifies the line (20) in the source
> code I'd like it to (and indicated when calling error with level 4).
> However, the traceback begins with 4 "extra" lines that'll likely
> confuse the person who's only seeing the client code... (while also
> exposing internal/implementation details I'd like to hide!).
The error level you pass to error() only influences the generated
error string. The traceback handler doesn't get any indication of
an error level and simply dumps the whole stack and appends it to
the error string.
I agree it's confusing and I hit the problem, too. But you cannot
do much about this without overriding the traceback handler. But,
oh well ... you can't call the original traceback handler for a
different stack level. So that's not such a smart idea, either.