diff options
author | Norbert Preining <norbert@preining.info> | 2022-09-19 03:02:32 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-09-19 03:02:32 +0000 |
commit | fe872ca5d5d1bb989da6b31802b8e0bfb0342e45 (patch) | |
tree | 4c2081c636a2b3eeb4ec5ecdb34fce9a507f5137 /biblio/citation-style-language/citeproc-util.lua | |
parent | baa3e10650110291de10e0e8e6a1e48ac4579afe (diff) |
CTAN sync 202209190302
Diffstat (limited to 'biblio/citation-style-language/citeproc-util.lua')
-rw-r--r-- | biblio/citation-style-language/citeproc-util.lua | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/biblio/citation-style-language/citeproc-util.lua b/biblio/citation-style-language/citeproc-util.lua index 38de3b5751..71221e6bec 100644 --- a/biblio/citation-style-language/citeproc-util.lua +++ b/biblio/citation-style-language/citeproc-util.lua @@ -72,7 +72,14 @@ end function util.error(message) if luatexbase then - luatexbase.module_error("citeproc", message) + -- The luatexbase.module_error() prints the traceback, which causes panic + -- luatexbase.module_error("citeproc", message) + + texio.write_nl("term", "\n") + tex.error("Module citeproc Error: " .. message) + + -- tex.print(string.format("\\PackageError{citation-style-language}{%s}{}", message)) + else error(message, 2) end @@ -82,9 +89,13 @@ util.warning_enabled = true function util.warning(message) if luatexbase then + texio.write_nl("term", "\n") luatexbase.module_warning("citeproc", message) + + -- tex.print(string.format("\\PackageWarning{citation-style-language}{%s}{}", message)) + elseif util.warning_enabled then - io.stderr:write(message, "\n") + io.stderr:write("Warning: " .. message, "\n") end end @@ -158,7 +169,7 @@ function util.split_multiple(str, seps, include_sep) end if #seps > 1 then - table.sort(splits, function(a, b) return a[1] < b[1] end) + table.sort(splits, function (a, b) return a[1] < b[1] end) end local res = {} @@ -972,7 +983,10 @@ function util.read_file(path) print(debug.traceback()) end local file = io.open(path, "r") - if not file then return nil end + if not file then + -- util.error(string.format('Cannot read file "%s".', path)) + return nil + end local content = file:read("*a") file:close() return content |