Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9060 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6940 invoked by uid 1010); 12 Apr 2004 12:54:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 6912 invoked from network); 12 Apr 2004 12:54:53 -0000 Received: from unknown (HELO asuka.nerv) (24.100.195.79) by pb1.pair.com with SMTP; 12 Apr 2004 12:54:53 -0000 Received: (qmail 27281 invoked from network); 12 Apr 2004 12:54:53 -0000 Received: from rei.nerv (HELO dummy.com) (rei@192.168.1.1) by asuka.nerv with SMTP; 12 Apr 2004 12:54:53 -0000 Reply-To: ilia@prohost.org To: internals@lists.php.net, Andi Gutmans Date: Mon, 12 Apr 2004 08:55:00 -0400 User-Agent: KMail/1.6.1 References: <1081740243.14476.11.camel@coogle.localdomain> <5.1.0.14.2.20040412134325.039c7758@127.0.0.1> In-Reply-To: <5.1.0.14.2.20040412134325.039c7758@127.0.0.1> Organization: Prohost.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: <200404120855.02983.ilia@prohost.org> Subject: Re: [PHP-DEV] Exceptions and Errors From: ilia@prohost.org (Ilia Alshanetsky) On April 12, 2004 06:45 am, Andi Gutmans wrote: > I don't see a problem with OOP extensions throwing exceptions. > Andi There is 1 problem with this approach. Currently an uncaught exceptions results in a fatal error (E_ERROR) meaning that if a particular method throws an exceptions it MUST be caught otherwise the script will terminate. Having to wrap some methods inside exceptions can be extremely frustrating since you may want to allow those methods to fail. For example the query method in SQLite can safely be allowed to fail in certain instances. In other instances when you care about failures there may be a need to implement custom handlers depending on the nature of the error. For example if a query fails due to a uniqness constrait, an UPDATE query would be ran while in all other instances an error would be logged etc... Ilia