This looks like an actual copy&paste of https://github.com/mongodb/mongo-php-driver/pull/629/files with a variable rename and paraphrased exception message?