carto: properly handle RestClient::ServiceUnavailable exceptions

This commit is contained in:
Pierre de La Morinerie 2019-02-06 10:33:14 +01:00
parent 42e323673b
commit b8978d2196

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