# Passing error codes through to PDOException

- Thread: https://externals.io/message/46652
- Original archive: https://news-web.php.net/php.internals/46652
- Started by Joey Smith on 2010-01-12T03:47:35+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #46652 — Joey Smith — 2010-01-12T03:47:35+00:00

URL: https://externals.io/message/46652#46652

Maybe I'm up in the night, but I've just opened 50728 because I discovered that all
the PDO drivers had a hardcoded 0 where I would expect to see the driver-specific
error - a user reported this in ##PHP on Freenode and I take a stab at writing the
patches that would let the individual drivers pass their error code on to the user.

They're attached to the bug as comments (the first against the tip of 5.3.2 
[svn #293440] and the second against HEAD [svn #293440]) - but I'm also attaching
them as udiffs to this email.

If there's a reason that the PDOExceptions don't contain their driver-specific
error codes, feel free to ignore this.

---

## #46653 — Joey Smith — 2010-01-12T03:59:46+00:00

URL: https://externals.io/message/46652#46653 · In reply to: #46652

I also just attached the following to the bug - it's a test that checks this fix in
the sqlite driver - I can write tests for all the others if need be, but I figured
there are others who might already be more familiar with the individual PDO drivers
that would write them more quickly than I.

---

## #46654 — Lester Caine — 2010-01-12T07:42:38+00:00

URL: https://externals.io/message/46652#46654 · In reply to: #46652

Joey Smith wrote:
> Maybe I'm up in the night, but I've just opened 50728 because I discovered that all
> the PDO drivers had a hardcoded 0 where I would expect to see the driver-specific
> error - a user reported this in ##PHP on Freenode and I take a stab at writing the
> patches that would let the individual drivers pass their error code on to the user.
> 
> They're attached to the bug as comments (the first against the tip of 5.3.2 
> [svn #293440] and the second against HEAD [svn #293440]) - but I'm also attaching
> them as udiffs to this email.
> 
> If there's a reason that the PDOExceptions don't contain their driver-specific
> error codes, feel free to ignore this.

Joey - there is a separate list for PDO development pdo@lists.php.net
And a todo list http://wiki.php.net/internals/pdo/brainstorming?s[]=pdo
But very little actual work being done, so any assistance there would be welcome!

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

---

## #46655 — Elizabeth M Smith — 2010-01-12T15:24:16+00:00

URL: https://externals.io/message/46652#46655 · In reply to: #46652

Joey Smith wrote:
> Maybe I'm up in the night, but I've just opened 50728 because I discovered that all
> the PDO drivers had a hardcoded 0 where I would expect to see the driver-specific
> error - a user reported this in ##PHP on Freenode and I take a stab at writing the
> patches that would let the individual drivers pass their error code on to the user.
> 
> They're attached to the bug as comments (the first against the tip of 5.3.2 
> [svn #293440] and the second against HEAD [svn #293440]) - but I'm also attaching
> them as udiffs to this email.
> 
> If there's a reason that the PDOExceptions don't contain their driver-specific
> error codes, feel free to ignore this.
> 

Patch looks good, Ilia put it in - thanks and as Richard said, feel free 
to send more PDO patches, someone with time/desire to actually do the 
work is always appreciated ;)

Elizabeth M Smith
