Hello,
I'm using this if loading failure is not fatal:
----
DoFile = function(fn)
return pcall(function() return dofile(fn) end)
end
DoFile("MyFile.lua") -- instead of 'dofile("MyFile.lua")'
----
You can play with handling error code (http://www.lua.org/manual/5.1/manual.html#pdf-pcall):
----
DoFile = function(fn)
local suc, res = pcall(function() return dofile(fn) end)
if suc then return res
else
-- Your handling code to come here
end
end
----
Best regards,
Lukas
On Thu, 13 Dec 2012 15:52:03 +0100, Andre Caldas
Hello, Philipp!
If I load a lua file from a module using \registerctxluafile{file}{1.001} or \ctxloadluafile{file} How can I be sure the file was in fact loaded?
The related tracker output is quite comprehensive:
\enabletrackers[resolvers.locating] \ctxloadluafile{sometest}
Nice! Thank you. In my case, it was not being loaded because I had syntax errors in the lua file. The file was found, but not loaded. I guess it is a very good reason to halt!
Cheers, André Caldas.
-- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038