Commit 17d4cac2080eb0c33d5daa5fc8174377b82bbc00
1 parent
a719bfc9
Exists in
master
and in
4 other branches
Rescue encoding error on controller level
Showing
2 changed files
with
10 additions
and
0 deletions
Show diff stats
app/controllers/application_controller.rb
| ... | ... | @@ -9,6 +9,10 @@ class ApplicationController < ActionController::Base |
| 9 | 9 | render "errors/gitolite", :layout => "error" |
| 10 | 10 | end |
| 11 | 11 | |
| 12 | + rescue_from Encoding::CompatibilityError do |exception| | |
| 13 | + render "errors/encoding", :layout => "error", :status => 404 | |
| 14 | + end | |
| 15 | + | |
| 12 | 16 | rescue_from ActiveRecord::RecordNotFound do |exception| |
| 13 | 17 | render "errors/not_found", :layout => "error", :status => 404 |
| 14 | 18 | end | ... | ... |