LanX has asked for the wisdom of the Perl Monks concerning the following question:
Hi
we have a large infrastructure based on catching die "string" errors and catching them with eval I want to introduce die $err_obj with Try::Tiny for a cleaner handling.
But for introduction we need to be backwards compatible, i.e. $err_obj should stringify via overload to a classical error string. Before reinventing the wheel I was skimming thru CPAN but couldn't quite find a ready to use solution.
Any recommendations?
update
talking about Throw looks promising ... :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: backwards compatible 'die $obj'
by choroba (Cardinal) on Sep 24, 2021 at 16:01 UTC | |
Re: backwards compatible 'die $obj'
by Corion (Patriarch) on Sep 27, 2021 at 15:18 UTC | |
by LanX (Saint) on Sep 27, 2021 at 15:29 UTC | |
Re: backwards compatible 'die $obj'
by perlancar (Hermit) on Sep 28, 2021 at 02:00 UTC | |
by LanX (Saint) on Sep 28, 2021 at 12:02 UTC | |
Re: backwards compatible 'die $obj' (grep.metacpan.org)
by LanX (Saint) on Sep 30, 2021 at 22:42 UTC |
Back to
Seekers of Perl Wisdom