From: Tom Hughes Date: Mon, 6 Mar 2017 17:50:09 +0000 (+0000) Subject: Detect a timeout encapsulated in ActionView::Template::Error X-Git-Tag: live~4058 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/88d16deadd6db1b45290e0d9a146af96fbb5d6bf?hp=6c0501d62a72fe217c522bcbf0017926c7e30fd6 Detect a timeout encapsulated in ActionView::Template::Error Fixes #1476 --- diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ff3f67efd..acc478c15 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -365,7 +365,8 @@ class ApplicationController < ActionController::Base rescue ActionView::Template::Error => ex ex = ex.original_exception - if ex.is_a?(ActiveRecord::StatementInvalid) && ex.message =~ /execution expired/ + if ex.is_a?(Timeout::Error) || + (ex.is_a?(ActiveRecord::StatementInvalid) && ex.message =~ /execution expired/) render :action => "timeout" else raise