Merge pull request #6984 from betagouv/fix-api-entreprise-error
Affichage d'un message clair en cas d'erreur `APIEntreprise::API::Error::ServiceUnavailable`
This commit is contained in:
commit
c6425cd1a6
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ class Champs::SiretController < ApplicationController
|
|||
|
||||
begin
|
||||
etablissement = find_etablissement_with_siret
|
||||
rescue APIEntreprise::API::Error::RequestFailed, APIEntreprise::API::Error::ServiceUnavailable
|
||||
rescue APIEntreprise::API::Error::RequestFailed, APIEntreprise::API::Error::BadGateway, APIEntreprise::API::Error::TimedOut, APIEntreprise::API::Error::ServiceUnavailable
|
||||
# i18n-tasks-use t('errors.messages.siret_network_error')
|
||||
return siret_error(:network_error)
|
||||
end
|
||||
|
|
|
@ -106,7 +106,7 @@ module Users
|
|||
sanitized_siret = siret_model.siret
|
||||
begin
|
||||
etablissement = APIEntrepriseService.create_etablissement(@dossier, sanitized_siret, current_user.id)
|
||||
rescue APIEntreprise::API::Error::RequestFailed, APIEntreprise::API::Error::BadGateway, APIEntreprise::API::Error::TimedOut
|
||||
rescue APIEntreprise::API::Error::RequestFailed, APIEntreprise::API::Error::BadGateway, APIEntreprise::API::Error::TimedOut, APIEntreprise::API::Error::ServiceUnavailable
|
||||
return render_siret_error(t('errors.messages.siret_network_error'))
|
||||
end
|
||||
if etablissement.nil?
|
||||
|
|
Loading…
Reference in a new issue