blob: 4b6c69a8b33f2ac0e2e03cece9b4c34676a9e465 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# frozen_string_literal: true
module Gitlab
module ErrorTracking
module Processor
module Concerns
module ProcessesExceptions
private
def extract_exceptions_from(event)
exceptions = if event.is_a?(Raven::Event)
event.instance_variable_get(:@interfaces)[:exception]&.values
else
event&.exception&.instance_variable_get(:@values)
end
Array.wrap(exceptions)
end
def set_exception_message(exception, message)
if exception.respond_to?(:value=)
exception.value = message
else
exception.instance_variable_set(:@value, message)
end
end
def valid_exception?(exception)
case exception
when Raven::SingleExceptionInterface, Sentry::SingleExceptionInterface
exception&.value.present?
else
false
end
end
end
end
end
end
end
|