lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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");

All that I get back is "assertion failed!". I don't see how I can wrap
pcall() around it, either.


Okay, at this point you're abusing sarcasm.
	- Buffy the Vampire Slayer