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: -
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: Open Package: PDO related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cmanley at xs4all dot nl
New email:
PHP Version: OS:

 

 [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

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Mar 28 21:01:22 2020 UTC