Stas Bekman wrote:
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 [EMAIL PROTECTED]

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 [EMAIL PROTECTED]


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 $@

Ah, I see, I didn't consider that failure case.

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).

Yes, this $@ save/restore logic could be added to filters only. But, still, in the case of a failing response handler & filter handler, you'd lose the error from the filter.

Maybe we need to be smarter about this a bit and somehow concatenate the
errors ?

--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to