catch exception while executing PDO query