Class: StackifyRubyAPM::Serializers::Errors Private

Inherits:
Serializer
  • Object
show all
Defined in:
lib/stackify_apm/serializers/errors.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from Serializer

#initialize

Constructor Details

This class inherits a constructor from StackifyRubyAPM::Serializers::Serializer

Instance Method Details

#build(error) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/stackify_apm/serializers/errors.rb', line 9

def build(error)
  if (exception = error.exception)
    current_timestamp = error.timestamp
    base = {
      CaughtBy: exception.module != '' ? exception.module : exception.type,
      Exception: exception.type,
      Message: exception.message,
      Timestamp: current_timestamp.round.to_s,
      Frames: exception.stacktrace.to_a
    }
  end

  base
end

#build_all(errors) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/stackify_apm/serializers/errors.rb', line 24

def build_all(errors)
  { exceptions: Array(errors).map(&method(:build)) }
end