Skip to content
Snippets Groups Projects
Commit 06468327 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Implemented default rescue in ApplicationController to avoid sending dev errors to the user

parent b690a062
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,12 @@ class ApplicationController < ActionController::API ...@@ -26,6 +26,12 @@ class ApplicationController < ActionController::API
# tracking user in papertrail # tracking user in papertrail
before_action :set_paper_trail_whodunnit before_action :set_paper_trail_whodunnit
rescue_from Exception do |exception|
logger.fatal exception
logger.fatal exception.backtrace.first(5).join("\n")
render status: :internal_server_error
end
# check if client application is allowed to consumes the API. # check if client application is allowed to consumes the API.
before_action :allow_client_application, if: -> { Feature.active?(:allow_client_application) } before_action :allow_client_application, if: -> { Feature.active?(:allow_client_application) }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment