lib/flexirest/request.rb in flexirest-1.7.5 vs lib/flexirest/request.rb in flexirest-1.7.6
- old
+ new
@@ -815,10 +815,14 @@
@method = options[:method]
end
def message
method = @method.try(:upcase)
- "Sending #{method} to '#{@request_url}' returned a #{@status} with the body of - #{@raw_response}"
+ "The #{method} to '#{@request_url}' returned a #{@status} status, which raised a #{self.class.to_s} with a body of: #{@raw_response}"
+ end
+
+ def to_s
+ message
end
end
class HTTPClientException < HTTPException ; end
class HTTPUnauthorisedClientException < HTTPClientException ; end
class HTTPBadRequestClientException < HTTPClientException ; end