Module: Rookout::Processor::NamespaceSerializer

Defined in:
lib/rookout/processor/namespace_serializer.rb

Class Method Summary collapse

Class Method Details

.dump(namespace, log_errors) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rookout/processor/namespace_serializer.rb', line 10

def dump namespace, log_errors
  namespace.dump log_errors
rescue StandardError => e
  message = "Failed to serialize namespace"
  variant = Com::Rookout::Variant.new variant_type: :VARIANT_ERROR

  if log_errors
    Logger.instance.exception message, e

    error = RookError.new e, message
    variant.error_value = error.dumps
  end
  variant
end