From: Tom Hughes Date: Thu, 21 May 2009 10:02:26 +0000 (+0000) Subject: Give the API error handler a generic rescue that returns 500 with X-Git-Tag: live~7923 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/97769170fde23c0bd113cff47cbd2977c727d180 Give the API error handler a generic rescue that returns 500 with the exception details. --- diff --git a/app/controllers/application.rb b/app/controllers/application.rb index f166df21d..2f8bd776d 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -115,6 +115,8 @@ class ApplicationController < ActionController::Base rescue OSM::APIError => ex render_opts = ex.render_opts report_error render_opts[:text], render_opts[:status] + rescue Exception => ex + render :text => "#{ex.class}: #{ex.message}", :status => :internal_server_error end end