Class: Serf::Messages::CaughtExceptionEvent

Inherits:
Object
  • Object
show all
Includes:
Serf::Message, Util::Uuidable
Defined in:
lib/serf/messages/caught_exception_event.rb

Overview

An event message to signal that the serf code caught an exception during the processing of some message, which is represented by the context field.

Instances of this class are norminally published to an error channel for out of band processing/notification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util::Uuidable

#uuid

Methods included from Serf::Message

#kind, #to_hash, #to_json, #to_msgpack

Constructor Details

#initialize(options = {}) ⇒ CaughtExceptionEvent

Returns a new instance of CaughtExceptionEvent.



23
24
25
26
27
28
# File 'lib/serf/messages/caught_exception_event.rb', line 23

def initialize(options={})
  @context = options[:context]
  @error_message = options[:error_message]
  @error_backtrace = options[:error_backtrace]
  @uuid = options[:uuid]
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



19
20
21
# File 'lib/serf/messages/caught_exception_event.rb', line 19

def context
  @context
end

#error_backtraceObject

Returns the value of attribute error_backtrace.



21
22
23
# File 'lib/serf/messages/caught_exception_event.rb', line 21

def error_backtrace
  @error_backtrace
end

#error_messageObject

Returns the value of attribute error_message.



20
21
22
# File 'lib/serf/messages/caught_exception_event.rb', line 20

def error_message
  @error_message
end

Instance Method Details

#attributesObject



30
31
32
33
34
35
36
37
# File 'lib/serf/messages/caught_exception_event.rb', line 30

def attributes
  {
    'context' => @context,
    'error_message' => @error_message,
    'error_backtrace' => @error_backtrace,
    'uuid' => uuid
  }
end

#to_sObject



39
40
41
# File 'lib/serf/messages/caught_exception_event.rb', line 39

def to_s
  to_hash.to_s
end