I really wish rails would stop trying to hide exceptions from me...
authorTom Hughes <tom@compton.nu>
Wed, 13 Jan 2010 13:34:59 +0000 (13:34 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 13 Jan 2010 13:34:59 +0000 (13:34 +0000)
app/controllers/browse_controller.rb

index 5c7912d154ec12a73769c6a41d8ee9de4e5021db..a77b0f94a48f71939e16243282e27735bd0f9ac2 100644 (file)
@@ -84,6 +84,12 @@ private
     SystemTimer.timeout_after(30) do
       yield
     end
+  rescue ActionView::TemplateError => ex
+    if ex.original_exception.is_a?(Timeout::Error)
+      render :action => "timeout", :status => :request_timeout
+    else
+      raise
+    end
   rescue Timeout::Error
     render :action => "timeout", :status => :request_timeout
   end