radareorg / radare2-bindings

Bindings of the r2 api for Valabind and friends
GNU Lesser General Public License v3.0
130 stars 92 forks source link

more useful syntax error for lua plugin #190

Closed xzcvczx closed 6 years ago

xzcvczx commented 6 years ago

currently when there is an error with lua code, even something like required modules not being found the error returned is "syntax error: error in error handling", this patch will print the code the error occured in.

this was the error that was seen in #9111 and #4793 and the issue is missing modules, homebrew lua doesn't contain json.lua and the homebrew radare script doesn't install it either (although json.lua is included in radare2-bindings), and there is also an issue with r_core, i assume the 3rd line that was seen by homebrew users was caused by the next line running and expecting r_core to be accessible.