perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Filter and Handlers should not reset $@ if it was set before entering
Date Mon, 09 Aug 2004 21:51:33 GMT
Philippe M. Chiasson wrote:

>> Would it be better to localize $@ instead of copying and restoring it?
> 
> 
> I wish we could do that, and it was the first thing I attempted.
> 
> The problem is that if we do that, even conditionnaly only when $@ is set
> on entry, it means that any _real_ errors triggered during the execution
> of the handler (setting $@) will also be lost and replaced with the 
> previous
> value for $@.
> 
> That's why we need to save $@ if it was set, and only restore if nothing
> failed during handler execution, otherwise we squish the new $@.

I see. So in case the filter has failed, and the response handler has 
failed we won't see the error from a response handler. So that solves 
only half a problem, as we still lose handlers $@

That's why I thought that it'll be better to find a different place to 
localize $@, i.e. outside the scope of the code that runs the handler 
and checks $@ on return. but this is probably not quite feasible. How 
about making a special case for filters (inside the filters code).

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message