-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure write error is included in exception message #724
Conversation
Implement new CRUD specification prose test for write error details JAVA-3993
import static org.junit.Assert.assertTrue; | ||
import static org.junit.Assert.fail; | ||
import static org.junit.Assume.assumeTrue; | ||
|
||
// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.rst#prose-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was copy pasta-d from elsewhere.
/** | ||
* See https://github.com/mongodb/specifications/blob/master/source/crud/tests/README.rst#prose-tests | ||
*/ | ||
public class CrudProseTest extends DatabaseTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed class to indicate the spec from which the prose tests came
@@ -33,7 +33,7 @@ | |||
* @param serverAddress the server address | |||
*/ | |||
public MongoWriteException(final WriteError error, final ServerAddress serverAddress) { | |||
super(error.getCode(), error.getMessage(), serverAddress); | |||
super("Write operation error on server " + serverAddress + ". Write error: " + error + ". ", serverAddress); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensures that the whole write error, including details, will show up as part of the exception message. This matches the behavior of MongoBulkWriteException.
Converted to draft as tests are failing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Implement new CRUD specification prose test for write error details JAVA-3993
Implement new CRUD specification prose test for write error details JAVA-3993
Implement new CRUD specification prose test for write error details
JAVA-3993