Sha256: 7336b3076df8570db571a41f87fcca48db2dbf17c841ed48495e7c4719b851bd
Contents?: true
Size: 782 Bytes
Versions: 18
Compression:
Stored size: 782 Bytes
Contents
require "logtail/util" require "logtail/event" module Logtail module Events # @private class Error < Logtail::Event attr_reader :name, :error_message, :backtrace_json def initialize(attributes) @name = attributes[:name] @error_message = attributes[:error_message] if attributes[:backtrace] @backtrace_json = attributes[:backtrace].to_json end end def message message = "#{name}" if !error_message.nil? message << " (#{error_message})" end message end def to_hash { error: { name: name, message: error_message, backtrace_json: backtrace_json } } end end end end
Version data entries
18 entries across 18 versions & 2 rubygems