Opened 15 years ago
Closed 15 years ago
#10293 closed enhancement (fixed)
Error conditions of WPDB unparseable by Code
Reported by: | dd32 | Owned by: | |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
I'm developing something which is making use of a new WPDB class, However, i've run into a slight issue with error handling.
I'd like to have the ability to tell what the error was while attempting to connect, without having to display the verbose text error to the user.
My thought is to store a error code in the WP_Error extra section, Or maybe change the 500 error code to be the default, unless something else is supplied..
See patch for the first thought, the 500 idea only just came to mind..
Theres a 2nd issue which is outlined in that patch, the Username in the select-db message may be incorrect for custom-connected DB's not using the DB_* constants.. see patch which stores the username in a class var..
Attachments (2)
Change History (7)
#4
@
15 years ago
- Keywords dev-feedback 2nd-opinion removed
- Milestone changed from Future Release to 2.9
attachment 10293.2.diff added
The reason i'm suggesting this, Is because i'm using wp-db.php in another project: "WordPress Quick Install"(http://wpquickinstall.com/) I was hoping to be able to catch error conditionals from the database credentials page and mentioning that the database doesnt exist, not just "Theres an error with the input, try again"... While not reverting to using mysql_* based commands..
I can work around it however (Just include a modified file) but would like to see it change in WordPress.
The other item is, It'd be nice to be able to get the error code/message for failed queries without resorting to mysql_* functions just in case someone has decided to abstract the DB layer... I may've completely missed a method for that though...