Sha256: 5a42aec82cd374cfdd1debda1b47d66afa017f3cbbfb15ff3f30605129aa0c22
Contents?: true
Size: 812 Bytes
Versions: 83
Compression:
Stored size: 812 Bytes
Contents
# Datadog global namespace module Datadog # Error is a value-object responsible for sanitizing/encapsulating error data class Error attr_reader :type, :message, :backtrace def self.build_from(value) case value when Error then value when Array then new(*value) when Exception then new(value.class, value.message, value.backtrace) when ContainsMessage then new(value.class, value.message) else BlankError end end def initialize(type = nil, message = nil, backtrace = nil) backtrace = Array(backtrace).join("\n") @type = Utils.utf8_encode(type) @message = Utils.utf8_encode(message) @backtrace = Utils.utf8_encode(backtrace) end BlankError = Error.new ContainsMessage = ->(v) { v.respond_to?(:message) } end end
Version data entries
83 entries across 83 versions & 2 rubygems