Created
June 20, 2011 06:46
-
-
Save nrk/1035222 to your computer and use it in GitHub Desktop.
Using pcall in Lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lol = { | |
wut = function(self, ...) | |
error("LOL WUT") | |
end, | |
} | |
-- this would normally be used like: lol:wut(1,2) | |
local s,e = pcall(lol.wut, lol, 1, 2) | |
print(s,e) -- false lol.lua:3: LOL WUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment