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.
This commit is contained in:
evazion
2021-01-07 02:26:31 -06:00
parent b223a87868
commit 59d64a76f3

View File

@@ -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