Catch PDO exceptions

Stop all the evil things from being evil and make them nice.