Skip to content

Instantly share code, notes, and snippets.

@bakpakin
Created September 20, 2019 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakpakin/dae61ab4a724114e68989656cc20b6d3 to your computer and use it in GitHub Desktop.
Save bakpakin/dae61ab4a724114e68989656cc20b6d3 to your computer and use it in GitHub Desktop.
Fix for bad stacktraces in fennel.
diff --git a/fennel.lua b/fennel.lua
index 8c79320..58341df 100644
--- a/fennel.lua
+++ b/fennel.lua
@@ -2057,7 +2057,8 @@ local function traceback(msg, start)
local level = start or 2 -- Can be used to skip some frames
local lines = {}
if msg then
- table.insert(lines, msg)
+ local stripped = msg:gsub('^[^:]*:%d+:%s+', 'runtime error: ')
+ table.insert(lines, stripped)
end
table.insert(lines, 'stack traceback:')
while true do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment