PHP: Custom error handler for PDO?

rojerandy

New Member
I am attempting to try to do something useful with PDO exceptions other than display them, but I cannot find for the life of me how to use an error handler (set_error_handler) or anything custom to deal with PDOs exceptions. Now I am using \[code\]try\[/code\]..\[code\]catch\[/code\] blocks of course the catch the exception, do I implement a custom error handler in the \[code\]catch\[/code\] part, or can I skip the try->catch block completely as the exception handler would handle it for me (by calling \[code\]or throw new exception (...)\[/code\] on the statement?I guess what I am asking is an example to catch PDO exceptions and log them more or less (any simple code correct or not I can use, I'm not TOO dumb).
 
Back
Top