Treat partial success from api entreprises as errors

We might refine this later, but for now this will give an error instead of unspecified state
This commit is contained in:
Paul Chavard 2018-03-26 17:44:37 +02:00
parent d72e0e92a9
commit 2505419b08

View file

@ -36,7 +36,7 @@ class ApiEntreprise::API
params: params, params: params,
timeout: 20) timeout: 20)
if response.success? if response.success? && response.code != 206
JSON.parse(response.body, symbolize_names: true) JSON.parse(response.body, symbolize_names: true)
else else
raise RestClient::ResourceNotFound raise RestClient::ResourceNotFound