Module: Twenty::Command::RescueMixin

Included in:
Connect, Console, Disconnect, Down, Migrate, Up
Defined in:
lib/twenty/cli/command/mixin/rescue_mixin.rb

Instance Method Summary collapse

Instance Method Details

#runObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/twenty/cli/command/mixin/rescue_mixin.rb', line 5

def run(...)
  super(...)
rescue => ex
  require "paint"
  $stderr.print "\n",
                "  ", Paint[" Exception ", :white, :red, :bold], "\n",
                "  ", Paint[ex.class.to_s, :bold], "\n",
                "  ", ex.message, "\n\n",
                "  ", Paint[" Backtrace ", :white, :blue, :bold], "\n",
                format_backtrace(ex.backtrace), "\n",
                "\n"
end