Exception: EXEL::Error::JobTermination

Inherits:
Exception
  • Object
show all
Defined in:
lib/exel/error/job_termination.rb

Overview

If a processor raises a JobTermination exception, the job will immediately stop running without raising anything. This is useful if you want to stop a job without triggering any kind of retry mechanism, for example.

Constant Summary collapse

CMDS =
[:info, :warn, :error].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, cmd = :error) ⇒ JobTermination

Returns a new instance of JobTermination.



13
14
15
16
# File 'lib/exel/error/job_termination.rb', line 13

def initialize(message = nil, cmd = :error)
  super(message)
  @cmd = CMDS.include?(cmd) ? cmd : :error
end

Instance Attribute Details

#cmdObject (readonly)

Inherit from Exception so it won’t be rescued and can propagate to ASTNode#start



9
10
11
# File 'lib/exel/error/job_termination.rb', line 9

def cmd
  @cmd
end