Permalink
Browse files

JAVA-757: Made CommandFailureException public. Added Javadoc

  • Loading branch information...
1 parent 7897a3b commit 2ed798f029bef844769b56e2aeff904c2e75aaee @jyemin jyemin committed Feb 15, 2013
@@ -17,11 +17,15 @@
package com.mongodb;
-class CommandFailureException extends MongoException {
- private static final long serialVersionUID = 1L;
+/**
+ * An exception indicating a failed command.
+ */
+public class CommandFailureException extends MongoException {
+ private static final long serialVersionUID = -1180715413196161037L;
private final CommandResult commandResult;
/**
+ * Construct a new instance with the CommandResult from a failed command
*
* @param commandResult the result
*/
@@ -30,6 +34,11 @@ public CommandFailureException(CommandResult commandResult){
this.commandResult = commandResult;
}
+ /**
+ * Gets the getlasterror command result document.
+ *
+ * @return the command result
+ */
public CommandResult getCommandResult() {
return commandResult;
}
@@ -26,6 +26,11 @@
private final CommandResult commandResult;
+ /**
+ * Construct a new instance with the CommandResult from getlasterror command
+ *
+ * @param commandResult the command result
+ */
public WriteConcernException(final CommandResult commandResult) {
super(commandResult.getCode(), commandResult.toString());
this.commandResult = commandResult;

0 comments on commit 2ed798f

Please sign in to comment.