Permalink
Browse files

Fixed errors in assert macros.

  • Loading branch information...
kevincox committed Jun 7, 2012
1 parent 92fa34b commit 9123863afdc5a6abdf7b26ab3ddac241e4a5065d
Showing with 2 additions and 2 deletions.
  1. +2 −2 lua/pl/utils.lua
View
@@ -477,7 +477,7 @@ end
-- @usage assert_arg(n,val,'string',path.isdir,'not a directory')
function utils.assert_arg (n,val,tp,verify,msg,lev)
if type(val) ~= tp then
- error(("argument %d expected a '%s', got a '%s'"):format(n,tp,type(val)),2)
+ error(("argument %d expected a '%s', got a '%s'"):format(n,tp,type(val)),lev or 2)
end
if verify and not verify(val) then
error(("argument %d: '%s' %s"):format(n,val,msg),lev or 2)
@@ -489,7 +489,7 @@ end
-- @param val a value that must be a string
-- @raise val must be a string
function utils.assert_string (n,val)
- utils.assert_arg(n,val,'string',nil,nil,nil,3)
+ utils.assert_arg(n,val,'string',nil,nil,3)
end
local err_mode = 'default'

0 comments on commit 9123863

Please sign in to comment.