From 59d64a76f3dd6ca576f714b97ea74cb504acacca Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 7 Jan 2021 02:26:31 -0600 Subject: [PATCH] tests: fix debug_mode option. Fix debug mode to only re-raise unexpected exceptions. Fixes debug mode breaking controller tests that expected to throw exceptions. --- app/controllers/application_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index af1317760..30fa3bcfc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -88,8 +88,6 @@ class ApplicationController < ActionController::Base end def rescue_exception(exception) - raise exception if Danbooru.config.debug_mode - case exception when ActionView::Template::Error rescue_exception(exception.cause) @@ -120,6 +118,7 @@ class ApplicationController < ActionController::Base when PG::ConnectionBad render_error_page(503, exception, message: "The database is unavailable. Try again later.") else + raise exception if Danbooru.config.debug_mode render_error_page(500, exception) end end