moonscript icon indicating copy to clipboard operation
moonscript copied to clipboard

MoonScript traceback rewriting does not properly handle non-string error values

Open RyanSquared opened this issue 7 years ago • 1 comments

ryan@buttstallion ~ 19:09:41 % moon test.moon                     
/usr/bin/lua5.1: ...e/ryan/.luarocks/share/lua/5.1/moonscript/errors.lua:81: attempt to call method 'match' (a nil value)
stack traceback:
        ...e/ryan/.luarocks/share/lua/5.1/moonscript/errors.lua:81: in function 'rewrite_single'
        ...e/ryan/.luarocks/share/lua/5.1/moonscript/errors.lua:98: in function 'rewrite_traceback'
        ...rocks/lib/luarocks/rocks/moonscript/0.5.0-1/bin/moon:105: in function <...rocks/lib/luarocks/rocks/moonscript/0.5.0-1/bin/moon:47>
        (tail call): ?
        [C]: ?
1 ryan@buttstallion ~ 19:09:44 % cat test.moon                                                                                                    
error({})
ryan@buttstallion ~ 19:09:48 %

RyanSquared avatar Oct 14 '18 00:10 RyanSquared

I am also hitting this. One workaround is to essentially xpcall the whole user-program and call tostring on all errors.

s-ol avatar May 08 '20 22:05 s-ol