Update rescue.rb
This commit is contained in:
parent
4f162796b0
commit
b0d6c19ab4
1 changed files with 5 additions and 5 deletions
|
@ -2,8 +2,8 @@
|
|||
|
||||
module Twenty::Command::Hook
|
||||
module Rescue
|
||||
FRAME_MAX = 15
|
||||
INDENT_BY = 2
|
||||
FRAMEMAX = 15
|
||||
INDENTBY = 2
|
||||
|
||||
def run(...)
|
||||
super(...)
|
||||
|
@ -12,7 +12,7 @@ module Twenty::Command::Hook
|
|||
$stderr.print "\n",
|
||||
" ", Paint[" Exception ", :white, :red, :bold], "\n",
|
||||
" ", Paint[ex.class.to_s, :bold], "\n",
|
||||
ex.message.each_line.map { [" " * INDENT_BY, _1] }.join,
|
||||
ex.message.each_line.map { [" " * INDENTBY, _1] }.join,
|
||||
"\n\n",
|
||||
" ", Paint[" Backtrace ", :white, :blue, :bold], "\n",
|
||||
format_backtrace(ex.backtrace), "\n",
|
||||
|
@ -22,8 +22,8 @@ module Twenty::Command::Hook
|
|||
private
|
||||
|
||||
def format_backtrace(backtrace)
|
||||
backtrace[0..FRAME_MAX - 1].map do
|
||||
[" " * INDENT_BY, _1.gsub(Dir.getwd, "")].join
|
||||
backtrace[0..FRAMEMAX - 1].map do
|
||||
[" " * INDENTBY, _1.gsub(Dir.getwd, "")].join
|
||||
end.join("\n")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue