Subject: | predefined propagate or rethrow function |
Hi,
It would be convenient if there was a predefined propagate/rethrow
function like this:
if ( my $e = Exception::Class->caught('SomeException') )
{
# handle exception
}
else
{
Exception::Class->Rethrow();
}
The code inside of propogate/rethrow function would be:
$e = Exception::Class->caught();
ref $e ? $e->rethrow : die $e;
Which is equivalent to the example in the synopsis of the documentation.
Obviously if $@ was just a string then the die call would originate from
the function but it is already off in my opinion by this point
regardless of the convenience function.