Exception: Trailblazer::Activity::Circuit::IllegalSignalError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/trailblazer/activity/circuit.rb

Overview

Common reasons to raise IllegalSignalError are when returning signals from

* macros which are not registered
* subprocesses where parent process have not registered that signal
* ciruit interface steps, for example: `step task: method(:validate)`

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task, signal:, outputs:, exec_context:) ⇒ IllegalSignalError

Returns a new instance of IllegalSignalError.



90
91
92
93
94
95
96
97
98
99
# File 'lib/trailblazer/activity/circuit.rb', line 90

def initialize(task, signal:, outputs:, exec_context:)
  @task = task
  @signal = signal

  message = "#{exec_context.class}: \n" \
    "\e[31mUnrecognized Signal `#{signal.inspect}` returned from #{task.inspect}. Registered signals are, \e[0m\n" \
    "\e[32m#{outputs.keys.map(&:inspect).join("\n")}\e[0m"

  super(message)
end

Instance Attribute Details

#signalObject (readonly)



88
89
90
# File 'lib/trailblazer/activity/circuit.rb', line 88

def signal
  @signal
end

#taskObject (readonly)



88
89
90
# File 'lib/trailblazer/activity/circuit.rb', line 88

def task
  @task
end