Exception: AllegroGraph::ExtendedTransport::UnexpectedStatusCodeError
- Inherits:
-
StandardError
- Object
- StandardError
- AllegroGraph::ExtendedTransport::UnexpectedStatusCodeError
- 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
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code, message) ⇒ UnexpectedStatusCodeError
constructor
A new instance of UnexpectedStatusCodeError.
- #to_s ⇒ Object
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, ) @status_code, @message = status_code, end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
13 14 15 |
# File 'lib/allegro_graph/extended_transport.rb', line 13 def @message end |
#status_code ⇒ Object (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_s ⇒ Object
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 |