Merge pull request #10922 from demarches-simplifiees/fix_10921

Gestion de nouveaux codes d'erreur dans l'API Entreprise
This commit is contained in:
Paul Chavard 2024-10-11 15:37:48 +00:00 committed by GitHub
commit 8266f7ff6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 1 deletions

View file

@ -141,7 +141,7 @@ class APIEntreprise::API
def service_unavailable?(response)
return true if response.code == 503
if response.code == 502 || response.code == 504
parse_response_errors(response).any? { _1.is_a?(Hash) && ["01000", "01001", "01002"].include?(_1[:code]) }
parse_response_errors(response).any? { _1.is_a?(Hash) && ["01000", "01001", "01002", "02002", "03002"].include?(_1[:code]) }
end
end