Created
September 20, 2019 04:14
-
-
Save bakpakin/dae61ab4a724114e68989656cc20b6d3 to your computer and use it in GitHub Desktop.
Fix for bad stacktraces in fennel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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