hmm.. it seems there is no way to catch a Puppet f...
# bolt
y
hmm.. it seems there is no way to catch a Puppet function exception in a Bolt plan (even when wrapped with another plan with _catch_errors => true)
Though I can write a
really_catch_errors()
function I guess..
c
catch_error is careful to only catch objects that derive from
Bolt::Error
class. What type of error are you trying to catch?
y
actually, I’m not really sure yet 😄 I’m writing a kind of
kubectl
wrapper Puppet function to use it in Bolt. So I’m thinking about error processing and retries
I don’t want to retry in Ruby.. so far I can return a Bolt::Error which can be intercepted with
catch_errors()
but.. I forgot why I was looking for a way to catch more..
c
Cool. yeah in your function definition (the ruby file) you will want to make sure you are doing robust exception handling. If you want to raise Bolt::Errors in that code for use with catch_errors that should work.
y
maybe I was thinking about a helper library function to use underneath.. but then I can rescue the exception and convert it in the Puppet Ruby function to the Bolt::Error also..
so nevermind.. I guess I was overthinking a bit 🙂