Exception: Flexirest::HTTPException

Inherits:
RequestException show all
Defined in:
lib/flexirest/request.rb

Direct Known Subclasses

HTTPClientException, HTTPServerException

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ HTTPException

Returns a new instance of HTTPException.



809
810
811
812
813
814
815
# File 'lib/flexirest/request.rb', line 809

def initialize(options)
  @status = options[:status]
  @result = options[:result]
  @request_url = options[:url]
  @raw_response = options[:raw_response]
  @method = options[:method]
end

Instance Attribute Details

#request_urlObject

Returns the value of attribute request_url.



808
809
810
# File 'lib/flexirest/request.rb', line 808

def request_url
  @request_url
end

#resultObject

Returns the value of attribute result.



808
809
810
# File 'lib/flexirest/request.rb', line 808

def result
  @result
end

#statusObject

Returns the value of attribute status.



808
809
810
# File 'lib/flexirest/request.rb', line 808

def status
  @status
end

Instance Method Details

#messageObject



817
818
819
820
# File 'lib/flexirest/request.rb', line 817

def message
  method = @method.try(:upcase)
  "Sending #{method} to '#{@request_url}' returned a #{@status} with the body of - #{@raw_response}"
end