Sha256: 7006dccc513b4f2254ec447d324f1ffd95587b6eb58c1f3b1969a3502b7528ec
Contents?: true
Size: 1.61 KB
Versions: 16
Compression:
Stored size: 1.61 KB
Contents
# typed: ignore # Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html require 'sqreen/kit/configuration' require 'sqreen/kit/signals/point' require 'sqreen/kit/signals/dto_helper' # reference: https://github.com/sqreen/SignalsSchemas/blob/master/schemas/payload/sqreen_exception/2020-01-01T00_00_00_000Z/schema.cue module Sqreen module Kit module Signals module Specialized end end end end class Sqreen::Kit::Signals::Specialized::SqreenException < Sqreen::Kit::Signals::Point PAYLOAD_SCHEMA_VERSION = 'sqreen_exception/2020-01-01T00:00:00.000Z'.freeze # @return [Hash] attr_accessor :infos # @return [Exception] attr_accessor :ruby_exception add_mandatory_attrs :source, :time, :ruby_exception validate_str_attr :source, /\A(?:sqreen:rule:[a-f0-9]{40}:.+)|(?:sqreen:agent:.+)\z/ def self.attributes_for_to_h_self [] # don't include ruby_exception in list of attributes for to_h end 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 def payload return nil unless @ruby_exception compact_hash({ klass: @ruby_exception.class.to_s, message: @ruby_exception.message, infos: @infos, }) end def location return nil unless @ruby_exception Sqreen::Kit::Signals::Location.new(exception: @ruby_exception) end end
Version data entries
16 entries across 16 versions & 1 rubygems