Class: Conductor::Worker::Events::ThreadUncaughtException

Inherits:
ConductorEvent
  • Object
show all
Defined in:
lib/conductor/worker/events/task_runner_events.rb

Overview

Published when a worker thread terminates with an uncaught exception

Instance Attribute Summary collapse

Attributes inherited from ConductorEvent

#timestamp

Instance Method Summary collapse

Constructor Details

#initialize(cause:, task_type: nil) ⇒ ThreadUncaughtException

Returns a new instance of ThreadUncaughtException.



245
246
247
248
249
# File 'lib/conductor/worker/events/task_runner_events.rb', line 245

def initialize(cause:, task_type: nil)
  super()
  @cause = cause
  @task_type = task_type
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



243
244
245
# File 'lib/conductor/worker/events/task_runner_events.rb', line 243

def cause
  @cause
end

#task_typeObject (readonly)

Returns the value of attribute task_type.



243
244
245
# File 'lib/conductor/worker/events/task_runner_events.rb', line 243

def task_type
  @task_type
end

Instance Method Details

#to_hObject



251
252
253
# File 'lib/conductor/worker/events/task_runner_events.rb', line 251

def to_h
  super.merge(cause: @cause.class.name, cause_message: @cause.message, task_type: @task_type)
end