Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32868 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59659 invoked by uid 1010); 19 Oct 2007 00:20:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59633 invoked from network); 19 Oct 2007 00:20:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Oct 2007 00:20:40 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 216.148.227.155 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 216.148.227.155 rwcrmhc15.comcast.net NetCache Data OnTap 5.x Received: from [216.148.227.155] ([216.148.227.155:46383] helo=rwcrmhc15.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/30-61918-658F7174 for ; Thu, 18 Oct 2007 20:20:39 -0400 Received: from earth.ufp (c-71-228-13-89.hsd1.il.comcast.net[71.228.13.89]) by comcast.net (rwcrmhc15) with ESMTP id <20071019002035m1500a1qdae>; Fri, 19 Oct 2007 00:20:35 +0000 Received: from localhost (localhost [127.0.0.1]) by earth.ufp (Postfix) with ESMTP id DEF1ED8296 for ; Thu, 18 Oct 2007 19:20:36 -0500 (CDT) Received: from earth.ufp ([127.0.0.1]) by localhost (earth.ufp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bUOOARCCtLw2 for ; Thu, 18 Oct 2007 19:20:36 -0500 (CDT) Received: from vulcan.ufp (vulcan.ufp [192.168.42.4]) by earth.ufp (Postfix) with ESMTP id C8B75D8295 for ; Thu, 18 Oct 2007 19:20:36 -0500 (CDT) To: internals@lists.php.net Date: Thu, 18 Oct 2007 19:20:33 -0500 User-Agent: KMail/1.9.6 References: <1192703377.3026.18.camel@johannes.nop> <2D3110B2-1DD0-4E9F-A2D5-F9D118BAFE0A@pooteeweet.org> In-Reply-To: <2D3110B2-1DD0-4E9F-A2D5-F9D118BAFE0A@pooteeweet.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200710181920.33387.larry@garfieldtech.com> Subject: Re: [PHP-DEV] exception policy for core From: larry@garfieldtech.com (Larry Garfield) On Thursday 18 October 2007, Lukas Kahwe Smith wrote: > > The possibility of changing the error mode at run-time makes it quite > > hard to read code. Since you always have to check the error mode of > > the > > object you're currently looking at. Therefore I think we should avoid > > adding more of these switches in future - especially on an per-object > > basis. > > Well I agree that this can be problematic. In the case of PDO one > might be passing a PDO instance to various libraries, which may rely > on exceptions being thrown or not. Personally I would not mind not > throwing exceptions for anything but constructor errors (actually I > think even those should be avoided), but that switch in PDO seemed > like an acceptable balance. > > regards, > Lukas I've actually had issues in the past with PDO and non-exception error-mode handling. I had queries that were running fine but when I checked the error value it gave a non-OK value. (I forget what off hand.) As soon as I switched to exceptions, it worked perfectly. I believe this was under 5.2.1. -- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson