Exception: Micky::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/micky/errors.rb

Direct Known Subclasses

ClientError, ServerError

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, original_exception: nil, response: nil) ⇒ Error

Returns a new instance of Error.



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/micky/errors.rb', line 3

def initialize(message = nil, original_exception: nil, response: nil)
  if response
    super "#{response.code} #{response.message} at #{response.uri}"
  elsif original_exception
    super original_exception.inspect
  elsif message
    super message
  else
    super
  end
end