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
[EMAIL PROTECTED]               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

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

Reply via email to