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

sanitize_error_message_processor.rb « processor « error_tracking « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1d6547256c7fca1496f6004f825a4490523c1eb3 (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
# frozen_string_literal: true

module Gitlab
  module ErrorTracking
    module Processor
      module SanitizeErrorMessageProcessor
        extend Gitlab::ErrorTracking::Processor::Concerns::ProcessesExceptions

        class << self
          def call(event)
            exceptions = extract_exceptions_from(event)

            exceptions.each do |exception|
              next unless valid_exception?(exception)

              message = Gitlab::Sanitizers::ExceptionMessage.clean(exception.type, exception.value)

              set_exception_message(exception, message)
            end

            event
          end
        end
      end
    end
  end
end