an exception-handling wrapper for PDO