A platform for community discussion. Free, open, simple.
FIX: regression, missing 404 page
Sam2437b0d5318f
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex 57e9de2953d..52a94b4d3c4 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -153,7 +153,7 @@ class ApplicationController < ActionController::Baseendend- rescue_from Discourse::NotFound, PluginDisabled do+ rescue_from Discourse::NotFound, PluginDisabled, ActionController::RoutingError dorescue_discourse_actions(:not_found, 404)enddiff --git a/lib/middleware/discourse_public_exceptions.rb b/lib/middleware/discourse_public_exceptions.rbindex c3364281332..4770b427934 100644--- a/lib/middleware/discourse_public_exceptions.rb+++ b/lib/middleware/discourse_public_exceptions.rb@@ -17,12 +17,22 @@ module Middlewareresponse = ActionDispatch::Response.newif exception- fake_controller = ApplicationController.new- fake_controller.response = response+ begin+ fake_controller = ApplicationController.new+ fake_controller.response = response+ fake_controller.request = ActionDispatch::Request.new(env)- if ApplicationController.rescue_with_handler(exception, object: fake_controller)- return [response.status, response.headers, response.body]+ if ApplicationController.rescue_with_handler(exception, object: fake_controller)+ body = response.body+ if String === body+ body = [body]+ end+ return [response.status, response.headers, body]+ end+ rescue => e+ Discourse.warn_exception(e, message: "Failed to handle exception in exception app middleware")end+endsuperend