Exception: RestEasy::RequestError

Inherits:
Error
  • Object
show all
Defined in:
lib/rest_easy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_or_message = nil) ⇒ RequestError

Returns a new instance of RequestError.



47
48
49
50
51
52
53
54
# File 'lib/rest_easy.rb', line 47

def initialize(response_or_message = nil)
  if response_or_message.respond_to?(:status)
    @response = response_or_message
    super("Request failed: #{response_or_message.status}")
  else
    super(response_or_message)
  end
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



45
46
47
# File 'lib/rest_easy.rb', line 45

def response
  @response
end