HomePhorge

(PUP-3379) Only rescue exceptions we intend to retry
23de3f6a3085Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-3379) Only rescue exceptions we intend to retry

Previously, we rescued all StandardErrors, checked if the rescued
exception is in the list of rescue-able exceptions, and re-raised if it
wasn't in the list.

Also, the caller was expected to specify the list of rescue-able
exceptions as a Hash, where the key was the exception, and the value was
the message to log when the exception was caught. That seemed a little
odd, and if that behavior is actually wanted, it would be better for the
caller to supply a callback for logging the message.

This commit modifies the retry action to accept an array of rescue-able
exceptions. If none are specified, it defaults to StandardError. The
retry action will only catch exceptions that it intends to retry,
simplifying the retry logic.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUc210b884c975: (PUP-3379) Don't retry if block raises fatal error
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU23de3f6a3085: (PUP-3379) Only rescue exceptions we intend to retry (authored by Josh Cooper <josh@puppetlabs.com>).Dec 4 2014, 1:19 AM