Class: Sentry::Processor::LogAsWarning

Inherits:
Raven::Processor
  • Object
show all
Defined in:
lib/sentry/processor/log_as_warning.rb

Constant Summary collapse

SENTRY_LOG_LEVEL_WARNING =
30
RELEVANT_EXCEPTIONS =
[
  Common::Exceptions::GatewayTimeout,
  EVSS::ErrorMiddleware::EVSSError
].freeze

Instance Method Summary collapse

Instance Method Details

#process(data) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/sentry/processor/log_as_warning.rb', line 16

def process(data)
  stringified_data = data.deep_stringify_keys
  return stringified_data if stringified_data['exception'].blank?
  return set_warning_level(stringified_data) if stringified_data['extra'].try(:[], 'log_as_warning')

  exception_class = get_exception_class(stringified_data)

  RELEVANT_EXCEPTIONS.each do |relevant_exception|
    return set_warning_level(stringified_data) if exception_class <= relevant_exception
  end

  stringified_data
end