]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api_controller.rb
Merge remote-tracking branch 'upstream/pull/5273'
[rails.git] / app / controllers / api_controller.rb
index 84398ad617ac8299849b68e464f5aa568eec3b51..17c98fe8b657e4c52acf6133084a786110405d90 100644 (file)
@@ -3,6 +3,8 @@ class ApiController < ApplicationController
 
   before_action :check_api_readable
 
+  around_action :api_call_handle_error, :api_call_timeout
+
   private
 
   ##
@@ -132,7 +134,7 @@ class ApiController < ApplicationController
     report_error message, :bad_request
   rescue OSM::APIError => e
     report_error e.message, e.status
-  rescue AbstractController::ActionNotFound => e
+  rescue AbstractController::ActionNotFound, CanCan::AccessDenied => e
     raise
   rescue StandardError => e
     logger.info("API threw unexpected #{e.class} exception: #{e.message}")