Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-07-05 00:02:01 +0300
committerStan Hu <stanhu@gmail.com>2017-07-05 00:03:46 +0300
commit73d019e11f163104010511ff04893194be6d2ebc (patch)
tree2009c6828bd33bd0de5a8f470948c9bbb262687a /app/controllers/application_controller.rb
parentb5b4054d5882782892d0a860c7e95db9a22bfdec (diff)
Log rescued exceptions to Sentry
Support noticed that a number of exceptions, such as "Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT)", failed to report to Sentry. The `rescue_from` in the ApplicationController prevented these exceptions from being recorded. This change ensures that these exceptions are properly captured.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 824ce845706..b4c0cd0487f 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -110,6 +110,8 @@ class ApplicationController < ActionController::Base
end
def log_exception(exception)
+ Raven.capture_exception(exception) if sentry_enabled?
+
application_trace = ActionDispatch::ExceptionWrapper.new(env, exception).application_trace
application_trace.map!{ |t| " #{t}\n" }
logger.error "\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}"