lua-users home
lua-l archive

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


On Sun, Nov 27, 2011 at 01:19, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Sun, Nov 27, 2011 at 10:06 AM, HyperHacker <hyperhacker@gmail.com> wrote:
>> previous error loading module 'foo'". How can I see what the previous
>> error was?
>
> By looking at the second returned value from pcall(require,'foo').
>
> steve d.
>

Well I meant without doing that; i.e. someone somewhere earlier in the
program already did that pcall() and it failed and now I'm trying to
load the module a second time and want to know what went wrong.
Anyway, I guess the solution should have been obvious: just set
package.loaded.foo = nil and require() will throw the original error
again.

-- 
Sent from my toaster.