Tony Olekshy wrote:
> Glenn Linderman wrote:
> >
> > Some discussion has been made about ignoring errors from certain
> > parts of the code. This is the only item that gets more complex
> > with exception handling--they must be ignored explicitly
> >
> > { & ignore_my_errors ( @params ); catch {}};
>
> I don't see how it gets more complicated if you really want to
> ignore errors. If you really want to ignore errors, you have to do
> this in Perl 5 right now anyway, but you say eval { ... }; instead.
open ( FOO, "<$file" );
ignores errors.
eval ( open ( FOO, "<$file" ));
ignores fatalities.
However, if non-fatal errors are returned via exceptions, then they
become harder to ignore than return codes that report non-fatal errors.
That's how. I think there is some confusion between errors and fatalies
when people are discussing this.
> What people really want is to ignore failure returns only, and
> still get the benefit of Perl's or the module author's judgement
> call on when to die because it's "really" serious. So do I,
> sometimes, when I'm at that level of DWIM. That's why RFC 88
> doesn't affect that current Perl 5 behaviour.
And that's slightly harder if exceptions are used for non-fatal errors.
It requires the catch.
> > "enabling/disabling fatality for exceptions with a pragma"... if
> > the idea is that control continues linearly past a throw, then
> > sub/module authors must write twice the error handling logic,
>
> Exceptions should not be disableable except under the conditions
> discussed in RFC 88. Internal to their modules, authors can use
> scoped C<use fatal;> if they want exception-based from the ground up.
> Then, and only if they want to support the other style, and only for
> public API subroutines, they do something like one of these:
I think we agree that both/either type of APIs can be provided by a
module author with suitable wrappers. Or a module can provide one, and
another module written to wrap it and provide the other. I think we
agree that an exception, if thrown, should be caught and handled (perhaps
with a null handler), or the program should terminate.
--
Glenn
=====
There are two kinds of people, those
who finish what they start, and so
on... -- Robert Byrne
_______________________________________________
Why pay for something you could get for free?
NetZero provides FREE Internet Access and Email
http://www.netzero.net/download/index.html