php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53909 PDOException needs info about PDO object or driver that triggered exception.
Submitted: 2011-02-02 14:22 UTC Modified: 2020-11-05 15:52 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: cmanley at xs4all dot nl Assigned:
Status: Suspended Package: PDO related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-02-02 14:22 UTC] 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.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-05 15:52 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2020-11-05 15:52 UTC] cmb@php.net
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>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC