diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-13 19:32:54 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-17 12:39:23 +0300 |
commit | 5f7f5eda925801cdc3b0932a3485a00d967c916c (patch) | |
tree | 99b002aff3e5a98110571d950f0569fee164269a /spec/lib/gitlab/diff | |
parent | a56611e3892b9039f6a8196c37d8b70a3c86c68b (diff) |
Method to track recoverable exceptions in sentry
This adds a method to track errors that can be recovered from in
sentry.
It is useful when debugging performance issues, or exceptions that are
hard to reproduce.
Diffstat (limited to 'spec/lib/gitlab/diff')
-rw-r--r-- | spec/lib/gitlab/diff/highlight_spec.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/lib/gitlab/diff/highlight_spec.rb b/spec/lib/gitlab/diff/highlight_spec.rb index 73d60c021c8..7c9e8c8d04e 100644 --- a/spec/lib/gitlab/diff/highlight_spec.rb +++ b/spec/lib/gitlab/diff/highlight_spec.rb @@ -79,6 +79,8 @@ describe Gitlab::Diff::Highlight do end it 'keeps the original rich line' do + allow(Gitlab::Sentry).to receive(:track_exception) + code = %q{+ raise RuntimeError, "System commands must be given as an array of strings"} expect(subject[5].text).to eq(code) @@ -86,12 +88,9 @@ describe Gitlab::Diff::Highlight do end it 'reports to Sentry if configured' do - allow(Gitlab::Sentry).to receive(:enabled?).and_return(true) - - expect(Gitlab::Sentry).to receive(:context) - expect(Raven).to receive(:capture_exception) + expect(Gitlab::Sentry).to receive(:track_exception).and_call_original - subject + expect { subject }. to raise_exception(RangeError) end end end |