Exception: AMEE::BadData

Inherits:
Exception
  • Object
show all
Defined in:
lib/amee/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil) ⇒ BadData

Returns a new instance of BadData.



7
8
9
10
11
# File 'lib/amee/exceptions.rb', line 7

def initialize(msg = nil)
  super(msg)
  @msg = msg
  @last_err = $!
end

Instance Method Details

#to_sObject



12
13
14
15
16
17
18
# File 'lib/amee/exceptions.rb', line 12

def to_s
  if @last_err
    [@msg, @last_err.message, @last_err.backtrace.first].join "\n"
  else
    super
  end
end