summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-28 21:42:02 +0000
committerKarl Berry <karl@freefriends.org>2016-04-28 21:42:02 +0000
commitf529089ae21bedbfe683bb242c18309d5f4bf034 (patch)
tree3f887a79f53cfefc2150bd4494d0ac094708d66a /Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua
parent51e82ac99ed852a234fdbe3e1a6bf7166132e470 (diff)
luaotfload (28apr16)
git-svn-id: svn://tug.org/texlive/trunk@40803 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua26
1 files changed, 25 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua
index 51a06574a25..9e8d0881226 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua
@@ -111,9 +111,33 @@ local make_loader = function (prefix)
return function (name)
local t_0 = osgettimeofday ()
local modname = make_loader_name (prefix, name)
- local data = require (modname)
+ --- We don’t want the stack info from inside, so just pcall().
+ local ok, data = pcall (require, modname)
local t_end = osgettimeofday ()
timing_info.t_load [name] = t_end - t_0
+ if not ok then
+ io.write "\n"
+ local msg = luaotfload.log and luaotfload.log.report or print
+ msg ("both", 0, "load", "FATAL ERROR")
+ msg ("both", 0, "load", " × Failed to load module %q.",
+ tostring (modname))
+ local lines = string.split (data, "\n\t")
+ if not lines then
+ msg ("both", 0, "load", " × Error message: %q", data)
+ else
+ msg ("both", 0, "load", " × Error message:")
+ for i = 1, #lines do
+ msg ("both", 0, "load", " × %q.", lines [i])
+ end
+ end
+ io.write "\n\n"
+ local debug = debug
+ if debug then
+ io.write (debug.traceback())
+ io.write "\n\n"
+ end
+ os.exit(-1)
+ end
return data
end
end