Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:32869 php.internals:32872 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58191 invoked by uid 1010); 19 Oct 2007 06:40:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58176 invoked from network); 19 Oct 2007 06:40:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Oct 2007 06:40:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 85.10.196.195 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 85.10.196.195 serveforce1.backendmedia.com Linux 2.6 Received: from [85.10.196.195] ([85.10.196.195:39598] helo=serveforce1.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/48-00686-66158174 for ; Fri, 19 Oct 2007 02:40:39 -0400 Received: from [192.168.0.151] (77-57-23-243.dclient.hispeed.ch [77.57.23.243]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by serveforce1.backendmedia.com (Postfix) with ESMTP id D3BD3122424A; Fri, 19 Oct 2007 08:41:06 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <200710181920.33387.larry@garfieldtech.com> References: <1192703377.3026.18.camel@johannes.nop> <2D3110B2-1DD0-4E9F-A2D5-F9D118BAFE0A@pooteeweet.org> <200710181920.33387.larry@garfieldtech.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <50EC9DA1-0828-4800-8C6B-7A6E8876F42B@pooteeweet.org> Content-Transfer-Encoding: 7bit Date: Fri, 19 Oct 2007 08:39:51 +0200 To: Larry Garfield , PHP Developers Mailing List X-Mailer: Apple Mail (2.752.3) X-backendmedia-com-MailScanner-Information: Please contact the ISP for more information X-backendmedia-com-MailScanner: Found to be clean X-backendmedia-com-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.136, required 6, AWL 0.04, RDNS_DYNAMIC 0.10) X-backendmedia-com-MailScanner-From: mls@pooteeweet.org X-Spam-Status: No Subject: Re: [PHP-DEV] exception policy for core From: mls@pooteeweet.org (Lukas Kahwe Smith) On 19.10.2007, at 02:20, Larry Garfield wrote: > 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. > > -- Well that sounds like a bug and not like a "feature" of exceptions. Or are you implying that the added complexity of this switch makes it harder to write bug free code. I do image that its a bit annoying to have to write tests to cover all the error modes. regards, Lukas