Try::Tiny::NoDie - minimal try/catch with local-disabling of SIGDIE
Preserves all of Try::Tiny's semantics to expect and handle exceptions but adds a try_no_die keyword which behaves exactly just like try but with a locally-disabled __DIE__ hook.
try_no_die
try
__DIE__
As such:
try_no_die { die "foo"; };
is exactly equivalent to:
try { local $SIG{__DIE__} = "IGNORE"; die "foo"; };
This module is primarily designed for developer convenience, for cases wherein the desired behavior within the scope of the error throwing code is a nullified __DIE__ handler.
Yes, that's possible.
However, as Try::Tiny aims to preserve compatibility as one of its design objective, Try::Tiny::NoDie holds a different opinion and offers this option to the developer.
As disabling __DIE__ within the scope of the error throwing code is a rather specific corner case, this poses a potential risk when the developer expects otherwise if the same keyword was to be overriden.
Due to this, a separate try_no_die keyword has been added instead.
Arnold Tan Casis <atancasis@cpan.org>
Copyright 2016- Arnold Tan Casis
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Try::Tiny
To install Try::Tiny::NoDie, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Try::Tiny::NoDie
CPAN shell
perl -MCPAN -e shell install Try::Tiny::NoDie
For more information on module installation, please visit the detailed CPAN module installation guide.