X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/783b5e3729228908d7404ae7404af1023501a906..233c6c0e97d994b92700f3e40d7b21b0da4f373c:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bee5e8169..045e93eb7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,7 +10,9 @@ class ApplicationController < ActionController::Base around_action :better_errors_allow_inline, :if => proc { Rails.env.development? } attr_accessor :current_user + helper_method :current_user + helper_method :preferred_langauges private @@ -185,6 +187,8 @@ class ApplicationController < ActionController::Base def api_call_handle_error yield + rescue ActionController::UnknownFormat + head :not_acceptable rescue ActiveRecord::RecordNotFound => e head :not_found rescue LibXML::XML::Error, ArgumentError => e