At 17:44 14/02/2004, George Schlossnagle wrote:

On Feb 14, 2004, at 8:08 AM, Zeev Suraski wrote:

At 19:50 13/02/2004, Sterling Hughes wrote:
Right.  Exception heirarchies are nice and all, but sometimes you want
exceptions to leak through, or be explicitly caught.  In-fact, I've
never encountered a case where this isn't what I want, maybe in a small
20 line example, but in large scripts I've almost always designed for
leakage.

My experience is a bit of the opposite, and the truth is somewhere in the middle I guess. But anyway, if you want to error out, why not just do that? Why go through the mess of coming up with an exception that will propagate through God knows how many checks and hopefully won't be caught?

Because you want it to be catchable by someone who is looking for it.

Are you talking about some plugin system where you want to send exceptions from lower layers to upper layers, bypassing the user-code in the middle? Otherwise, I don't see why you'd ever want to do that, and that's a fairly esoteric case. If you just want to be able to clean up nicely at the extension level or something like that, instead of using set_exception_handler() to identify this exception and do something special, why not use set_error_handler()?


Zeev

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to