Class: Tasker::Events::EventPayloadBuilder::ErrorInfoExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/tasker/events/event_payload_builder.rb

Overview

Service class to extract error information from step and context Reduces complexity by organizing error extraction logic

Class Method Summary collapse

Class Method Details

.extract(step, additional_context = {}) ⇒ Hash

Extract error information from step and context

Parameters:

  • step (WorkflowStep)

    The step with error

  • additional_context (Hash) (defaults to: {})

    Additional context

Returns:

  • (Hash)

    Error information payload



406
407
408
409
410
411
412
413
414
415
416
# File 'lib/tasker/events/event_payload_builder.rb', line 406

def extract(step, additional_context = {})
  error_payload = {}

  error_payload[:error_message] = extract_error_message(step, additional_context)
  error_payload[:exception_class] = extract_exception_class(additional_context)

  backtrace = extract_backtrace(step, additional_context)
  error_payload[:backtrace] = backtrace if backtrace

  error_payload
end