Exception: Bolt::PAL::PALError
Overview
PALError is used to convert errors from executing puppet code into Bolt::Errors
Instance Attribute Summary
Attributes inherited from Error
#details, #error_code, #issue_code, #kind
Class Method Summary collapse
-
.from_error(err) ⇒ Object
Generate a Bolt::Pal::PALError for non-bolt errors.
-
.from_preformatted_error(err) ⇒ Object
Puppet sometimes rescues exceptions notes the location and reraises.
Instance Method Summary collapse
-
#initialize(msg) ⇒ PALError
constructor
A new instance of PALError.
Methods inherited from Error
#msg, #to_h, #to_json, #to_puppet_error, unknown_plan, unknown_task
Constructor Details
#initialize(msg) ⇒ PALError
Returns a new instance of PALError.
35 36 37 |
# File 'lib/bolt/pal.rb', line 35 def initialize(msg) super(msg, 'bolt/pal-error') end |
Class Method Details
.from_error(err) ⇒ Object
Generate a Bolt::Pal::PALError for non-bolt errors
29 30 31 32 33 |
# File 'lib/bolt/pal.rb', line 29 def self.from_error(err) e = new(err.) e.set_backtrace(err.backtrace) e end |
.from_preformatted_error(err) ⇒ Object
Puppet sometimes rescues exceptions notes the location and reraises. Return the original error.
20 21 22 23 24 25 26 |
# File 'lib/bolt/pal.rb', line 20 def self.from_preformatted_error(err) if err.cause&.is_a? Bolt::Error err.cause else from_error(err.cause || err) end end |