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.
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.