File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -470,7 +470,9 @@ public Object eval( String code , Object ... args ){
470470 * @throws MongoException
471471 */
472472 public CommandResult getStats () {
473- return command ("dbstats" );
473+ CommandResult result = command ("dbstats" );
474+ result .throwOnError ();
475+ return result ;
474476 }
475477
476478 /**
Original file line number Diff line number Diff line change @@ -690,7 +690,9 @@ public CommandResult fsync(boolean async) {
690690 if (async ) {
691691 cmd .put ("async" , 1 );
692692 }
693- return getDB (ADMIN_DATABASE_NAME ).command (cmd );
693+ CommandResult result = getDB (ADMIN_DATABASE_NAME ).command (cmd );
694+ result .throwOnError ();
695+ return result ;
694696 }
695697
696698 /**
@@ -704,7 +706,9 @@ public CommandResult fsync(boolean async) {
704706 public CommandResult fsyncAndLock () {
705707 DBObject cmd = new BasicDBObject ("fsync" , 1 );
706708 cmd .put ("lock" , 1 );
707- return getDB (ADMIN_DATABASE_NAME ).command (cmd );
709+ CommandResult result = getDB (ADMIN_DATABASE_NAME ).command (cmd );
710+ result .throwOnError ();
711+ return result ;
708712 }
709713
710714 /**
You can’t perform that action at this time.
0 commit comments