I want to alter the way error messages and their backtrace are displayed without rescue-ing the errors and calling a custom method. Is there a way to do this? Is there a method that is called when error messages are displayed which can be overridden? If it is a built-in part of Ruby, can someone point me to the relevant C code that formats the error messages and the backtrace?
I want to alter the way error messages and their backtrace are displayed without
Share
matugm’s answer to a question that samuil linked pointed me to the way. I can do this:
This will not be effective for syntax errors, but for most other cases, it will work.