From 88d16deadd6db1b45290e0d9a146af96fbb5d6bf Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 6 Mar 2017 17:50:09 +0000 Subject: [PATCH] Detect a timeout encapsulated in ActionView::Template::Error Fixes #1476 --- app/controllers/application_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.39.5