lib/harvesting/client.rb in harvesting-0.5.0 vs lib/harvesting/client.rb in harvesting-0.5.1

- old
+ new

@@ -113,10 +113,11 @@ # @raise [UnprocessableRequest] When HTTP response is not 200 OK def delete(entity) url = "#{DEFAULT_HOST}/#{entity.path}" uri = URI(url) response = http_response(:delete, uri) - raise UnprocessableRequest(response.to_s) unless response.code.to_i == 200 + raise UnprocessableRequest.new(response.to_s) unless response.code.to_i == 200 + JSON.parse(response.body) end # Performs a GET request and returned the parsed JSON as a Hash. #