controllers: fix crash on APIEntreprise::API::Error::TimedOut

In that case we want to display the nicely formatted error message to the
user, instead of a "Error 500" page.
This commit is contained in:
Pierre de La Morinerie 2022-02-23 11:36:25 +01:00
parent 56c2e57aee
commit a2028e115b

View file

@ -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