]> git.openstreetmap.org Git - rails.git/commitdiff
Give the API error handler a generic rescue that returns 500 with
authorTom Hughes <tom@compton.nu>
Thu, 21 May 2009 10:02:26 +0000 (10:02 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 21 May 2009 10:02:26 +0000 (10:02 +0000)
the exception details.

app/controllers/application.rb

index f166df21d6075be39651f9350e54106e3f85703b..2f8bd776dd71c22e1e40e5ab05e628126117bf03 100644 (file)
@@ -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