mldvx4 has asked for the wisdom of the Perl Monks concerning the following question:
Greetings.
I am now re-writing a script from scratch to change the work flow and I might as well try to modernize exception handling a bit while in there. I used to use eval { } to attempt to trap errors. I need something else capable of trapping errors which occur several layers deep in dependent Perl modules. For example, XML::RSS is getting called by XML::Feed :
Modification of non-creatable array value attempted, subscript -1 at / +usr/share/perl5/XML/RSS.pm line 910.
However, that specific error only occurs when processing very large numbers of feeds and since eval { } can't do that, I figure it is time to check try { } catch {} or something like that.
Is there any approach which is preferred over the others for trapping exceptions?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Which incarnation of try/catch to use?
by Haarg (Priest) on Oct 02, 2023 at 11:29 UTC | |
Re: Which incarnation of try/catch to use?
by haukex (Archbishop) on Oct 02, 2023 at 12:29 UTC | |
by mldvx4 (Friar) on Oct 03, 2023 at 07:49 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 03, 2023 at 08:10 UTC | |
Re: Which incarnation of try/catch to use?
by tobyink (Canon) on Oct 02, 2023 at 13:06 UTC | |
Re: Which incarnation of try/catch to use?
by eyepopslikeamosquito (Archbishop) on Oct 02, 2023 at 21:14 UTC | |
Re: Which incarnation of try/catch to use?
by BillKSmith (Monsignor) on Oct 02, 2023 at 15:01 UTC |