Class: Raven::Processor::UTF8Conversion

Inherits:
Raven::Processor show all
Defined in:
lib/raven/processor/utf8conversion.rb

Constant Summary

Constants inherited from Raven::Processor

INT_MASK, REGEX_SPECIAL_CHARACTERS, STRING_MASK

Instance Method Summary collapse

Methods inherited from Raven::Processor

#initialize

Constructor Details

This class inherits a constructor from Raven::Processor

Instance Method Details

#process(value) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/raven/processor/utf8conversion.rb', line 3

def process(value)
  if value.is_a? Array
    value.map { |v| process v }
  elsif value.is_a? Hash
    value.merge(value) { |_, v| process v }
  elsif value.is_a?(Exception) && !value.message.valid_encoding?
    clean_exc = value.class.new(clean_invalid_utf8_bytes(value.message))
    clean_exc.set_backtrace(value.backtrace)
    clean_exc
  else
    clean_invalid_utf8_bytes(value)
  end
end