I have some code:
use Try::Tiny;
use Carp;
sub do_stuff {
Carp::croak('Something went wrong!');
}
sub do_other_stuff {
try {
say 'Doing some stuff...';
do_stuff();
} catch {
say 'Uh oh.';
Carp::croak($_);
}
}
do_other_stuff(); # Something went wrong! at line number for do_other_stuff
How can I re-throw the exception without changing the stack trace? Ideally the exception will be:
Something went wrong! at line number for do_stuff