Exception: Flexirest::HTTPException
- Inherits:
-
RequestException
- Object
- StandardError
- RequestException
- Flexirest::HTTPException
- Defined in:
- lib/flexirest/request.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Sets the attribute body.
-
#raw_response ⇒ Object
(also: #body)
Returns the value of attribute raw_response.
-
#request_url ⇒ Object
Returns the value of attribute request_url.
-
#result ⇒ Object
Returns the value of attribute result.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(options) ⇒ HTTPException
constructor
A new instance of HTTPException.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ HTTPException
Returns a new instance of HTTPException.
938 939 940 941 942 943 944 |
# File 'lib/flexirest/request.rb', line 938 def initialize() @status = [:status] @result = [:result] @request_url = [:url] @body = [:raw_response] @method = [:method] end |
Instance Attribute Details
#body=(value) ⇒ Object
Sets the attribute body
937 938 939 |
# File 'lib/flexirest/request.rb', line 937 def body=(value) @body = value end |
#raw_response ⇒ Object Also known as: body
Returns the value of attribute raw_response.
937 938 939 |
# File 'lib/flexirest/request.rb', line 937 def raw_response @raw_response end |
#request_url ⇒ Object
Returns the value of attribute request_url.
937 938 939 |
# File 'lib/flexirest/request.rb', line 937 def request_url @request_url end |
#result ⇒ Object
Returns the value of attribute result.
937 938 939 |
# File 'lib/flexirest/request.rb', line 937 def result @result end |
#status ⇒ Object
Returns the value of attribute status.
937 938 939 |
# File 'lib/flexirest/request.rb', line 937 def status @status end |
Instance Method Details
#message ⇒ Object
947 948 949 950 |
# File 'lib/flexirest/request.rb', line 947 def method = @method.try(:upcase) "The #{method} to '#{@request_url}' returned a #{@status} status, which raised a #{self.class.to_s} with a body of: #{@body}" end |
#to_s ⇒ Object
952 953 954 |
# File 'lib/flexirest/request.rb', line 952 def to_s end |