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 <[email protected]> 
wrote:

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:[email protected]]
Pontex s. r. o.      [mailto:[email protected]] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to