carto: present API InternalServerError to the user, instead of failing

This commit is contained in:
Pierre de La Morinerie 2019-01-24 18:30:14 +01:00
parent 4de069d436
commit 803364490d
4 changed files with 60 additions and 32 deletions

View file

@ -74,5 +74,9 @@ class Champs::CarteController < ApplicationController
if @champ.persisted?
@champ.save
end
rescue RestClient::ResourceNotFound
flash.alert = 'Les données cartographiques sont temporairement indisponibles. Réessayez dans un instant.'
response.status = 503
end
end