Exception: Embedly::BadResponseException

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/embedly/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, path = nil) ⇒ BadResponseException

Returns a new instance of BadResponseException.



4
5
6
7
# File 'lib/embedly/exceptions.rb', line 4

def initialize(response, path = nil)
  @response ||= response
  @path ||= path
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



2
3
4
# File 'lib/embedly/exceptions.rb', line 2

def path
  @path
end

#responseObject

Returns the value of attribute response.



2
3
4
# File 'lib/embedly/exceptions.rb', line 2

def response
  @response
end

Instance Method Details

#inspectObject



13
14
15
# File 'lib/embedly/exceptions.rb', line 13

def inspect
  self.message
end

#messageObject



9
10
11
# File 'lib/embedly/exceptions.rb', line 9

def message
  "Bad Response : #{@response.inspect} for path: #{@path.inspect}"
end

#to_sObject



17
18
19
# File 'lib/embedly/exceptions.rb', line 17

def to_s
  self.message
end