Exception: AllegroGraph::ExtendedTransport::UnexpectedStatusCodeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/allegro_graph/extended_transport.rb

Overview

The UnexpectedStatusCodeError is raised if the :expected_status_code option is given to the :request method and the responded status code is different from the expected one.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, message) ⇒ UnexpectedStatusCodeError

Returns a new instance of UnexpectedStatusCodeError.



15
16
17
# File 'lib/allegro_graph/extended_transport.rb', line 15

def initialize(status_code, message)
  @status_code, @message = status_code, message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



13
14
15
# File 'lib/allegro_graph/extended_transport.rb', line 13

def message
  @message
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



12
13
14
# File 'lib/allegro_graph/extended_transport.rb', line 12

def status_code
  @status_code
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/allegro_graph/extended_transport.rb', line 19

def to_s
  "#{super} received status code #{self.status_code}" + (@message ? " [#{@message}]" : "")
end