--TEST-- MongoDB\Driver\WriteResult::getWriteConcernError() works for errors without a message --SKIPIF-- --FILE-- false]); // Configure a fail point triggering a write concern error without message configureFailPoint( $manager, 'failCommand', ['times' => 1], [ 'failCommands' => ['insert'], 'writeConcernError' => ['code' => 91], ] ); $bulk = new MongoDB\Driver\BulkWrite(); $bulk->insert(['write' => 1]); $result = $manager->executeBulkWrite(NS, $bulk); var_dump($result->getWriteConcernError()); configureFailPoint($manager, 'failCommand', 'off'); ?> ===DONE=== --EXPECTF-- object(MongoDB\Driver\WriteConcernError)#%d (%d) { ["message"]=> string(0) "" ["code"]=> int(91) ["info"]=> NULL } ===DONE===