Class: ElasticAPM::Error::Exception Private

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_apm/error/exception.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.

Constant Summary collapse

MOD_SPLIT =

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

'::'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = nil) ⇒ Exception

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.

Returns a new instance of Exception.



26
27
28
29
30
31
32
# File 'lib/elastic_apm/error/exception.rb', line 26

def initialize(attrs = nil)
  return unless attrs

  attrs.each do |key, val|
    send(:"#{key}=", val)
  end
end

Instance Attribute Details

#attributesObject

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.



43
44
45
# File 'lib/elastic_apm/error/exception.rb', line 43

def attributes
  @attributes
end

#causeObject

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.



43
44
45
# File 'lib/elastic_apm/error/exception.rb', line 43

def cause
  @cause
end

#codeObject

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.



43
44
45
# File 'lib/elastic_apm/error/exception.rb', line 43

def code
  @code
end

#handledObject

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.



43
44
45
# File 'lib/elastic_apm/error/exception.rb', line 43

def handled
  @handled
end

#messageObject

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.



43
44
45
# File 'lib/elastic_apm/error/exception.rb', line 43

def message
  @message
end

#moduleObject

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.



43
44
45
# File 'lib/elastic_apm/error/exception.rb', line 43

def module
  @module
end

#stacktraceObject

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.



43
44
45
# File 'lib/elastic_apm/error/exception.rb', line 43

def stacktrace
  @stacktrace
end

#typeObject

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.



43
44
45
# File 'lib/elastic_apm/error/exception.rb', line 43

def type
  @type
end

Class Method Details

.from_exception(exception, **attrs) ⇒ 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.



34
35
36
37
38
39
40
41
# File 'lib/elastic_apm/error/exception.rb', line 34

def self.from_exception(exception, **attrs)
  new({
    message: exception.message.to_s,
    type: exception.class.to_s,
    module: format_module(exception),
    cause: exception.cause && Exception.from_exception(exception.cause)
  }.merge(attrs))
end

Instance Method Details

#inspectObject

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.



54
55
56
57
58
59
# File 'lib/elastic_apm/error/exception.rb', line 54

def inspect
  '<ElasticAPM::Error::Exception' \
    " type:#{type}" \
    " message:#{message}" \
    '>'
end