capture pdo exceptions.