[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: error(msg[, level]): level parameter ignored?
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Tue, 24 Jun 2014 02:19:55 +0200
I thought that the "level" parameter was supposed to shave some of the
call stack... What is happening here?
~$ lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> function foo(n) bar(n) end
> function bar(n) error("BAR", n) end
> foo(1)
stdin:1: BAR
stack traceback:
[C]: in function 'error'
stdin:1: in function 'bar'
stdin:1: in function 'foo'
stdin:1: in main chunk
[C]: ?
> foo(2)
stdin:1: BAR
stack traceback:
[C]: in function 'error'
stdin:1: in function 'bar'
stdin:1: in function 'foo'
stdin:1: in main chunk
[C]: ?
> foo(3)
stdin:1: BAR
stack traceback:
[C]: in function 'error'
stdin:1: in function 'bar'
stdin:1: in function 'foo'
stdin:1: in main chunk
[C]: ?
> foo(0)
BAR
stack traceback:
[C]: in function 'error'
stdin:1: in function 'bar'
stdin:1: in function 'foo'
stdin:1: in main chunk
[C]: ?
—Pierre-Yves