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 ){
470
470
* @throws MongoException
471
471
*/
472
472
public CommandResult getStats () {
473
- return command ("dbstats" );
473
+ CommandResult result = command ("dbstats" );
474
+ result .throwOnError ();
475
+ return result ;
474
476
}
475
477
476
478
/**
Original file line number Diff line number Diff line change @@ -690,7 +690,9 @@ public CommandResult fsync(boolean async) {
690
690
if (async ) {
691
691
cmd .put ("async" , 1 );
692
692
}
693
- return getDB (ADMIN_DATABASE_NAME ).command (cmd );
693
+ CommandResult result = getDB (ADMIN_DATABASE_NAME ).command (cmd );
694
+ result .throwOnError ();
695
+ return result ;
694
696
}
695
697
696
698
/**
@@ -704,7 +706,9 @@ public CommandResult fsync(boolean async) {
704
706
public CommandResult fsyncAndLock () {
705
707
DBObject cmd = new BasicDBObject ("fsync" , 1 );
706
708
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 ;
708
712
}
709
713
710
714
/**
You can’t perform that action at this time.
0 commit comments