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
(also: #raw_response)
Returns the value of attribute body.
-
#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.
952 953 954 955 956 957 958 |
# File 'lib/flexirest/request.rb', line 952 def initialize() @status = [:status] @result = [:result] @request_url = [:url] @body = [:raw_response] @method = [:method] end |
Instance Attribute Details
#body ⇒ Object Also known as: raw_response
Returns the value of attribute body.
951 952 953 |
# File 'lib/flexirest/request.rb', line 951 def body @body end |
#request_url ⇒ Object
Returns the value of attribute request_url.
951 952 953 |
# File 'lib/flexirest/request.rb', line 951 def request_url @request_url end |
#result ⇒ Object
Returns the value of attribute result.
951 952 953 |
# File 'lib/flexirest/request.rb', line 951 def result @result end |
#status ⇒ Object
Returns the value of attribute status.
951 952 953 |
# File 'lib/flexirest/request.rb', line 951 def status @status end |
Instance Method Details
#message ⇒ Object
961 962 963 964 |
# File 'lib/flexirest/request.rb', line 961 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
966 967 968 |
# File 'lib/flexirest/request.rb', line 966 def to_s end |