I am trying to do something useful with PDO exceptions, except to display them, but I cannot find for myself how to use the error handler (set_error_handler) or anything normal to handle PDO exceptions.
Now I use try .. catch blocks, of course, a catch exception, I implement my own error handler in the catch part or I can completely skip the try-> catch block, since the exception handler would handle this for me (by calling or throw new exception (...) in the instructions?
I assume that I am asking for an example to catch PDO exceptions and register them more or less (any simple code is correct or not, I can use, I'm not too dumb).
php exception-handling pdo error-handling
John
source share