Skip to content

Commit 6b79055

Browse files
committed
[Bug Fix] Dispatch exceptions through the router so 500s aren't masked as 404
config.exceptions_app pointed at a lambda that always rendered the not_found action, so every unhandled error (including 500s such as a raising view) surfaced as a 404. That masked the DropdownMenu render error behind a misleading 'not found' page. Point exceptions_app at the router instead; the /404 and /500 routes already exist, so the response status now matches the actual error and ErrorsController#internal_server_error is finally reachable.
1 parent d5dcb89 commit 6b79055

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

docs/config/application.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class Application < Rails::Application
2424
# config.time_zone = "Central Time (US & Canada)"
2525
# config.eager_load_paths << Rails.root.join("extras")
2626

27-
config.exceptions_app = ->(env) { ErrorsController.action(:not_found).call(env) }
27+
# Dispatch exceptions through the router (see the /404 and /500 routes) so the
28+
# response status matches the actual error. A bare lambda to a single action
29+
# rendered every failure as 404, masking 500s (e.g. a raising view) as "not found".
30+
config.exceptions_app = routes
2831
end
2932
end

0 commit comments

Comments
 (0)