lib/flexirest/request.rb in flexirest-1.3.18 vs lib/flexirest/request.rb in flexirest-1.3.19
- old
+ new
@@ -409,11 +409,11 @@
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Response received #{@response.body.size} bytes"
end
result = generate_new_object(ignore_root: @method[:options][:ignore_root], ignore_xml_root: @method[:options][:ignore_xml_root])
# TODO: Cleanup when ignore_xml_root is removed
else
- raise ResponseParseException.new(status:status, body:@response.body)
+ raise ResponseParseException.new(status:status, body:@response.body, headers: @response.headers)
end
else
if is_json_response? || is_xml_response?
error_response = generate_new_object(mutable: false, ignore_xml_root: @method[:options][:ignore_xml_root])
else
@@ -609,13 +609,14 @@
class RequestException < StandardError ; end
class InvalidRequestException < RequestException ; end
class MissingParametersException < RequestException ; end
class ResponseParseException < RequestException
- attr_accessor :status, :body
+ attr_accessor :status, :body, :headers
def initialize(options)
@status = options[:status]
@body = options[:body]
+ @headers = options[:headers]
end
end
class HTTPException < RequestException
attr_accessor :status, :result, :request_url