mirror of
https://github.com/Reuh/candran.git
synced 2025-10-27 09:59:29 +00:00
Allow rewriting without new traceback
This commit is contained in:
parent
a3f05f5046
commit
f5752cd231
3 changed files with 5 additions and 5 deletions
|
|
@ -265,8 +265,8 @@ end
|
|||
|
||||
--- Candran error message handler.
|
||||
-- Use it in xpcall to rewrite stacktraces to display Candran source file lines instead of compiled Lua lines.
|
||||
function candran.messageHandler(message)
|
||||
if not message:match("\nstack traceback:\n") then
|
||||
function candran.messageHandler(message, noTraceback)
|
||||
if not noTraceback and not message:match("\nstack traceback:\n") then
|
||||
message = debug.traceback(message, 2)
|
||||
end
|
||||
return message:gsub("(\n?%s*)([^\n]-)%:(%d+)%:", function(indentation, source, line)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue