Merge pull request #3380 from betagouv/rescue-more-carto-errors

carto: properly handle RestClient::ServiceUnavailable exceptions
This commit is contained in:
Pierre de La Morinerie 2019-02-06 17:49:35 +01:00 committed by GitHub
commit 86939196e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ class ApiCarto::API
params = geojson.to_s
RestClient.post(url, params, content_type: 'application/json')
rescue RestClient::InternalServerError, RestClient::BadGateway, RestClient::GatewayTimeout => e
rescue RestClient::InternalServerError, RestClient::BadGateway, RestClient::GatewayTimeout, RestClient::ServiceUnavailable => e
Rails.logger.error "[ApiCarto] Error on #{url}: #{e}"
raise RestClient::ResourceNotFound
end