Skip to content

Instantly share code, notes, and snippets.

@semifor
Created October 24, 2012 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save semifor/3949094 to your computer and use it in GitHub Desktop.
Save semifor/3949094 to your computer and use it in GitHub Desktop.
sub retry_once {
my ($code, $msg) = @_;
try { $code->() }
catch {
WARN "RETRY $msg: $_";
try { $code->() }
catch {
ERROR "FAIL $msg: $_";
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment