File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ class ApplicationController < ActionController::Base
1111
1212 helper_method :signed_in? , :current_user
1313
14- rescue_from ActiveRecord ::RecordNotFound , with : :_404
15- rescue_from ActionView ::MissingTemplate , with : :_404
16- rescue_from ActionController ::UnknownFormat , with : :_404
14+ rescue_from ActiveRecord ::RecordNotFound , with : :_404
15+ rescue_from ActionView ::MissingTemplate , with : :_404
16+ rescue_from ActionController ::UnknownFormat , with : :_404
17+ rescue_from ActionController ::BadRequest , with : :_400
1718
1819 expose ( :jobs ) { Job . shuffled }
1920 expose ( :highlights ) { Highlight . active }
@@ -25,6 +26,11 @@ def setup
2526 switch_time_zone
2627 end
2728
29+ def _400 ( exception )
30+ Rails . logger . warn "400 bad_request: #{ exception . message } — #{ request . method } #{ request . path } (#{ request . remote_ip } )"
31+ head ( :bad_request )
32+ end
33+
2834 def _404 ( exception )
2935 Rails . logger . warn exception
3036 Rails . logger . warn "head 404 with params #{ params } "
You can’t perform that action at this time.
0 commit comments