Req #53909 [Opn->Sus]: PDOException needs info about PDO object or driver that triggered exception.
| From: | cmb@php.net | Date: | Thu, 05 Nov 2020 15:52:17 +0000 |
| Subject: | Req #53909 [Opn->Sus]: PDOException needs info about PDO object or driver that triggered exception. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230139@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=53909&edit=1
ID: 53909
Updated by: cmb@php.net
Reported by: cmanley at xs4all dot nl
Summary: PDOException needs info about PDO object or driver
that triggered exception.
-Status: Open
+Status: Suspended
Type: Feature/Change Request
Package: PDO related
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
This feature request requires discussion about the details and the
implementation, and this bug tracker is not suitable for this.
So, if you, or anybody else, is still interested in having this
feature, please forward the request to the internals mailing
list[1]. For the time being, I'm suspending this ticket.
[1] <https://www.php.net/mailing-lists.php#internals>
Previous Comments:
------------------------------------------------------------------------
[2011-02-02 14:22:27] cmanley at xs4all dot nl
Description:
------------
Please add a getPDODriver() and a getPDOObject() method to PDOException.
I want to create a custom subclass of PDOException that handles duplicate key violations and has an
accessor method to get the offending field(s).
To do this, I need to parse the database driver specific error message for the field names. This can
only be done if PDOException knows which database driver is being used. Unfortunately it does not
know this.
I can imagine more scenarios where PDOException needs information about the PDO object or driver (in
case PDO object couldn't even be instantiated) that triggered it.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=53909&edit=1