Rails multiline debug in byebug or how to rescue in single line Rails multiline debug in byebug or how to rescue in single line ruby ruby

Rails multiline debug in byebug or how to rescue in single line


When you enter multiple lines ruby code or in a single line on byebug, you need to escape the semicolon using backlash. The following should do the trick.

begin\; my_crashing_method.call\; rescue Exception => e\; puts e.backtrace end

https://github.com/deivid-rodriguez/byebug/blob/master/GUIDE.md#command-syntax