Merge pull request #5182 from betagouv/5113-async-for-api-ent-calls
raise exception with url
This commit is contained in:
commit
af6731578a
1 changed files with 3 additions and 3 deletions
|
@ -74,11 +74,11 @@ class ApiEntreprise::API
|
|||
if response.success?
|
||||
JSON.parse(response.body, symbolize_names: true)
|
||||
elsif response.code&.between?(401, 499)
|
||||
raise ResourceNotFound
|
||||
raise ResourceNotFound, "url: #{url}"
|
||||
elsif response.code == 400
|
||||
raise BadFormatRequest
|
||||
raise BadFormatRequest, "url: #{url}"
|
||||
else
|
||||
raise RequestFailed, "HTTP Error Code: #{response.code}"
|
||||
raise RequestFailed, "HTTP Error Code: #{response.code} for #{url}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue