def initialize(path, exception, timestamp = Time.now)
@exception_id = exception.object_id
@path = path
@exception_class_name = exception.is_a?(Exception) ? exception.class.name : 'Error'
@is_internal = (exception.class < NewRelic::Agent::InternalAgentError)
if exception.nil?
@message = '<no message>'
elsif exception.respond_to?(:cause)
@message = (exception.cause || exception).to_s
elsif exception.respond_to?(:original_exception)
@message = (exception.original_exception || exception).to_s
else
@message = exception.to_s
end
unless @message.is_a?(String)
@message = String(@message.inspect) rescue '<unknown message type>'
end
@message = @message[0..4095] if @message.length > 4096
if NewRelic::Agent.config['strip_exception_messages.enabled''strip_exception_messages.enabled'] &&
!self.class.passes_message_whitelist(exception.class)
@message = STRIPPED_EXCEPTION_REPLACEMENT_MESSAGE
end
@attributes_from_notice_error = nil
@attributes = nil
@timestamp = timestamp
end