[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: "Loop or previous error loading module" - how to get the error?
- From: HyperHacker <hyperhacker@...>
- Date: Sun, 27 Nov 2011 01:25:01 -0700
On Sun, Nov 27, 2011 at 01:19, steve donovan <email@example.com> wrote:
> On Sun, Nov 27, 2011 at 10:06 AM, HyperHacker <firstname.lastname@example.org> 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
Sent from my toaster.