Module: MiscHacks::ExceptionMixin

Defined in:
lib/mischacks.rb

Instance Method Summary collapse

Instance Method Details

#to_formatted_stringObject



81
82
83
84
85
86
87
88
# File 'lib/mischacks.rb', line 81

def to_formatted_string
  bt   = backtrace.dup
  head = bt.shift
  (
    ["#{head}: #{self} (#{self.class})"] +
    bt.map do |l| "\tfrom #{l}" end
  ).map do |l| "#{l}\n" end.join
end