Exception: Bolt::RunFailure

Inherits:
Error
  • Object
show all
Defined in:
lib/bolt/error.rb

Direct Known Subclasses

ApplyFailure

Instance Attribute Summary collapse

Attributes inherited from Error

#details, #error_code, #issue_code, #kind

Instance Method Summary collapse

Methods inherited from Error

#add_filelineno, #msg, #to_h, #to_json, #to_puppet_error, unknown_plan, unknown_task

Constructor Details

#initialize(result_set, action, object = nil) ⇒ RunFailure

Returns a new instance of RunFailure.



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/bolt/error.rb', line 67

def initialize(result_set, action, object = nil)
  details = {
    'action' => action,
    'object' => object,
    'result_set' => result_set
  }
  object_msg = " '#{object}'" if object
  message = "Plan aborted: #{action}#{object_msg} failed on #{result_set.error_set.length} target"
  message += "s" unless result_set.error_set.length == 1
  super(message, 'bolt/run-failure', details)
  @result_set = result_set
  @error_code = 2
end

Instance Attribute Details

#result_setObject (readonly)

Returns the value of attribute result_set.



65
66
67
# File 'lib/bolt/error.rb', line 65

def result_set
  @result_set
end