diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-04-27 23:06:27 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2016-04-27 23:06:27 +0200 |
commit | 6c52ede0dc26bf697e5cf2732dffab7bb8191473 (patch) | |
tree | c2425e083e73387d69afa6d349a3a3b8f19fb091 /src/luaotfload-main.lua | |
parent | e739376d6f7f55a74ecd215f2bd3b54a30367875 (diff) | |
parent | 23ff1b009f3b4df6754848196d7556c11c323d83 (diff) | |
download | luaotfload-6c52ede0dc26bf697e5cf2732dffab7bb8191473.tar.gz |
Merge pull request #345 from phi-gamma/master
first batch of fixes
Diffstat (limited to 'src/luaotfload-main.lua')
-rw-r--r-- | src/luaotfload-main.lua | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index 51a0657..9e8d088 100644 --- a/src/luaotfload-main.lua +++ b/src/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 |