File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 17
17
18
18
package com .mongodb ;
19
19
20
- class CommandFailureException extends MongoException {
21
- private static final long serialVersionUID = 1L ;
20
+ /**
21
+ * An exception indicating a failed command.
22
+ */
23
+ public class CommandFailureException extends MongoException {
24
+ private static final long serialVersionUID = -1180715413196161037L ;
22
25
private final CommandResult commandResult ;
23
26
24
27
/**
28
+ * Construct a new instance with the CommandResult from a failed command
25
29
*
26
30
* @param commandResult the result
27
31
*/
@@ -30,6 +34,11 @@ public CommandFailureException(CommandResult commandResult){
30
34
this .commandResult = commandResult ;
31
35
}
32
36
37
+ /**
38
+ * Gets the getlasterror command result document.
39
+ *
40
+ * @return the command result
41
+ */
33
42
public CommandResult getCommandResult () {
34
43
return commandResult ;
35
44
}
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ public class WriteConcernException extends MongoException {
26
26
27
27
private final CommandResult commandResult ;
28
28
29
+ /**
30
+ * Construct a new instance with the CommandResult from getlasterror command
31
+ *
32
+ * @param commandResult the command result
33
+ */
29
34
public WriteConcernException (final CommandResult commandResult ) {
30
35
super (commandResult .getCode (), commandResult .toString ());
31
36
this .commandResult = commandResult ;
You can’t perform that action at this time.
0 commit comments