summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-07-04 14:02:01 -0700
committerStan Hu <stanhu@gmail.com>2017-07-04 14:03:46 -0700
commit73d019e11f163104010511ff04893194be6d2ebc (patch)
tree2009c6828bd33bd0de5a8f470948c9bbb262687a
parentb5b4054d5882782892d0a860c7e95db9a22bfdec (diff)
downloadgitlab-ce-73d019e11f163104010511ff04893194be6d2ebc.tar.gz
Log rescued exceptions to Sentrysh-log-application-controller-exceptions-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.
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--changelogs/unreleased/sh-log-application-controller-exceptions-sentry.yml4
2 files changed, 6 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}"
diff --git a/changelogs/unreleased/sh-log-application-controller-exceptions-sentry.yml b/changelogs/unreleased/sh-log-application-controller-exceptions-sentry.yml
new file mode 100644
index 00000000000..ec9ceab3d81
--- /dev/null
+++ b/changelogs/unreleased/sh-log-application-controller-exceptions-sentry.yml
@@ -0,0 +1,4 @@
+---
+title: Log rescued exceptions to Sentry
+merge_request:
+author: