Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:183 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95489 invoked from network); 23 Mar 2003 15:33:23 -0000 Received: from unknown (HELO secure.thebrainroom.com) (213.239.42.171) by pb1.pair.com with SMTP; 23 Mar 2003 15:33:23 -0000 Received: from zaneeb.brainnet.i (brain.dial.nildram.co.uk [195.149.29.154]) by secure.thebrainroom.com (8.9.3/8.9.3) with ESMTP id PAA15647; Sun, 23 Mar 2003 15:51:46 GMT Received: from zaneeb.brainnet.i (IDENT:ObfFsYIfoIMFJ1vXEbsacwdzWldMWips@zaneeb.brainnet.i [127.0.0.1]) by zaneeb.brainnet.i (8.11.6/8.11.6) with ESMTP id h2NFXLb29819; Sun, 23 Mar 2003 15:33:22 GMT Date: Sun, 23 Mar 2003 15:33:21 +0000 (GMT) X-X-Sender: wez@zaneeb.brainnet.i To: Sterling Hughes cc: Stanislav Malyshev , Sebastian Bergmann , internals@lists.php.net In-Reply-To: <1048432076.848.2130.camel@hasele> Message-ID: References: <1048432076.848.2130.camel@hasele> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Re: Throwable interface From: wez@thebrainroom.com (Wez Furlong) We need to do at least one of the following: 1) Force all exceptions to be descendants of a builtin Exception class 2) Force all exceptions to implement a Throwable interface 3) Provide a catch-all syntax to the language for exception handling. This is *extremely* important for people writing such things as SOAP or RPC servers that want to keep their implementations as robust as possible. While we are at it, lets have the call to undefined method fatal error and the type-hint checking raise exceptions too; procedural code will still bail out if it doesn't catch the exception, while robust OO coders will be able to act on the event and handle it gracefully. --Wez. On Sun, 23 Mar 2003, Sterling Hughes wrote: > On Sun, 2003-03-23 at 10:24, Stanislav Malyshev wrote: > > SB>> The lack of a common interface of thrown exceptions hinders the > > SB>> development of applications like PHPUnit that need to be able to > > SB>> work with *every* possible exception. > > > > Don't we have a way to catch any exception in the language yet? > > > > If you want to catch any exception, just require people to define their > exceptions as extending the "exception" class, if they wish to use > phpunit. We shouldn't have an engine-level straightjacket on exceptions > (more of a response to sebastian's mail than to stas').