[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: How to display loadfile(scriptName) errors
- From: "Henderson, Michael D" <michael.d.henderson@...>
- Date: Fri, 09 Dec 2005 17:23:55 -0700
How can I retrieve any errors returned by loadfile? For example, if I
run "foo" from the command line, lua returns a nice error message:
$ lua ./foo.lua
lua: ./foo.lua:6: function arguments expected near `='
If I run it from loadfile, using
local chunk = loadfile("./foo.lua");
assert(chunk);
All that I get back is "assertion failed!". I don't see how I can wrap
pcall() around it, either.
Thanks,
Mike
Okay, at this point you're abusing sarcasm.
- Buffy the Vampire Slayer