Module: Twenty::Command::Hook::Rescue
- Defined in:
- lib/twenty/cli/command/hook/rescue.rb
Constant Summary collapse
- FRAME_MAX =
15- INDENT_BY =
2
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/twenty/cli/command/hook/rescue.rb', line 8 def run(...) super(...) rescue => ex require "paint" $stderr.print "\n", " ", Paint[" Exception ", :white, :red, :bold], "\n", " ", Paint[ex.class.to_s, :bold], "\n", ex..each_line.map { [" " * INDENT_BY, _1] }.join, "\n\n", " ", Paint[" Backtrace ", :white, :blue, :bold], "\n", format_backtrace(ex.backtrace), "\n", "\n" end |