Class: Sqreen::Kit::Signals::Specialized::SqreenException
- Inherits:
-
Point
- Object
- Point
- Sqreen::Kit::Signals::Specialized::SqreenException
- 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
-
#initialize(values = {}) ⇒ SqreenException
constructor
A new instance of SqreenException.
- #location ⇒ Object
- #payload ⇒ Object
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
#infos ⇒ Hash
25 26 27 |
# File 'lib/sqreen/kit/signals/specialized/sqreen_exception.rb', line 25 def infos @infos end |
#ruby_exception ⇒ Exception
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_self ⇒ Object
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
#location ⇒ Object
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 |
#payload ⇒ Object
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., infos: @infos, }) end |