diff options
Diffstat (limited to 'tex/context/base/trac-deb.lua')
-rw-r--r-- | tex/context/base/trac-deb.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tex/context/base/trac-deb.lua b/tex/context/base/trac-deb.lua index 109d84612..51b98c7f3 100644 --- a/tex/context/base/trac-deb.lua +++ b/tex/context/base/trac-deb.lua @@ -122,11 +122,21 @@ function tracers.printerror(offset) end end -function tracers.texerrormessage(...) -- for the moment we put this function here - local v = format(...) - tex.sprint(tex.ctxcatcodes,"\\errmessage{") - tex.sprint(tex.vrbcatcodes,v) - tex.print(tex.ctxcatcodes,"}") +if tex.error then + + function tracers.texerrormessage(...) -- for the moment we put this function here + tex.error(format(...), { }) + end + +else + + function tracers.texerrormessage(...) -- for the moment we put this function here + local v = format(...) + tex.sprint(tex.ctxcatcodes,"\\errmessage{") + tex.sprint(tex.vrbcatcodes,v) + tex.print(tex.ctxcatcodes,"}") + end + end directives.register("system.errorcontext", function(v) |