api_entreprise: display better error message when SIRET is private
Previously we blamed the network. Now we say that the entreprise infos cannot be retrieved. Which is not ideal, but better.
This commit is contained in:
parent
8c7d7f2eed
commit
55c9dfc001
3 changed files with 18 additions and 2 deletions
|
@ -34,7 +34,7 @@ class ApiEntreprise::API
|
|||
|
||||
if response.success?
|
||||
JSON.parse(response.body, symbolize_names: true)
|
||||
elsif response.code == 404 || response.code == 422
|
||||
elsif response.code&.between?(401, 499)
|
||||
raise RestClient::ResourceNotFound
|
||||
else
|
||||
raise RestClient::RequestFailed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue