Class: Sqreen::Kit::Signals::Specialized::SqreenException

Inherits:
Point
  • Object
show all
Defined in:
lib/sqreen/kit/signals/specialized/sqreen_exception.rb

Constant Summary collapse

PAYLOAD_SCHEMA_VERSION =
'sqreen_exception/2020-01-01T00:00:00.000Z'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values = {}) ⇒ SqreenException

Returns a new instance of SqreenException.



38
39
40
41
42
43
44
# File 'lib/sqreen/kit/signals/specialized/sqreen_exception.rb', line 38

def initialize(values = {})
  self.payload_schema = PAYLOAD_SCHEMA_VERSION
  self.signal_name = 'sq.agent.exception'
  self.time = values[:time] || Time.now
  self.source = values[:source] || Sqreen::Kit::Configuration.default_source
  super
end

Instance Attribute Details

#infosHash

Returns:

  • (Hash)


25
26
27
# File 'lib/sqreen/kit/signals/specialized/sqreen_exception.rb', line 25

def infos
  @infos
end

#ruby_exceptionException

Returns:



28
29
30
# File 'lib/sqreen/kit/signals/specialized/sqreen_exception.rb', line 28

def ruby_exception
  @ruby_exception
end

Class Method Details

.attributes_for_to_h_selfObject



34
35
36
# File 'lib/sqreen/kit/signals/specialized/sqreen_exception.rb', line 34

def self.attributes_for_to_h_self
  [] # don't include ruby_exception in list of attributes for to_h
end

Instance Method Details

#locationObject



55
56
57
58
# File 'lib/sqreen/kit/signals/specialized/sqreen_exception.rb', line 55

def location
  return nil unless @ruby_exception
  Sqreen::Kit::Signals::Location.new(exception: @ruby_exception)
end

#payloadObject



46
47
48
49
50
51
52
53
# File 'lib/sqreen/kit/signals/specialized/sqreen_exception.rb', line 46

def payload
  return nil unless @ruby_exception
  compact_hash({
                 klass: @ruby_exception.class.to_s,
                 message: @ruby_exception.message,
                 infos: @infos,
               })
end