From b8978d21964eb101598ba0e2c572cea4e0e8887f Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Wed, 6 Feb 2019 10:33:14 +0100 Subject: [PATCH] carto: properly handle RestClient::ServiceUnavailable exceptions --- app/lib/api_carto/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/api_carto/api.rb b/app/lib/api_carto/api.rb index 84bcd5d70..f94c11e2d 100644 --- a/app/lib/api_carto/api.rb +++ b/app/lib/api_carto/api.rb @@ -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