SERVER-113573 Remove "Extension encountered error" prefix from extension uasserts (#43680)
GitOrigin-RevId: 02d6f66bb97aba0433272f9e7ec464f4aa95ebd6
This commit is contained in:
parent
966de10cbe
commit
0560e59a0f
@ -28,7 +28,8 @@ function checkAssertionFailure({errmsg, code, assertionType}) {
|
||||
}),
|
||||
code,
|
||||
);
|
||||
assert.eq(res.errmsg, "Extension encountered error: " + errmsg, res);
|
||||
const expectedErrMsg = assertionType == "uassert" ? errmsg : "Extension encountered error: " + errmsg;
|
||||
assert.eq(res.errmsg, expectedErrMsg, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -400,9 +400,7 @@ TEST_F(ExtensionErrorsTest, ExtensionUasserts) {
|
||||
BSON("$assert" << BSON("errmsg" << "a new error" << "code" << 54321 << "assertionType"
|
||||
<< "uassert"))};
|
||||
ASSERT_THROWS_CODE(Pipeline::parse(pipeline, expCtx), AssertionException, 54321);
|
||||
ASSERT_THROWS_WHAT(Pipeline::parse(pipeline, expCtx),
|
||||
AssertionException,
|
||||
"Extension encountered error: a new error");
|
||||
ASSERT_THROWS_WHAT(Pipeline::parse(pipeline, expCtx), AssertionException, "a new error");
|
||||
}
|
||||
|
||||
DEATH_TEST_REGEX_F(ExtensionErrorsTest, ExtensionTasserts, "98765.*another new error") {
|
||||
|
||||
@ -132,8 +132,7 @@ MongoExtensionStatus* HostServicesAdapter::_extLogDebug(
|
||||
errorBson, IDLParserContext("extUassert"));
|
||||
|
||||
// Call the host's uassert implementation.
|
||||
uasserted(exceptionInfo.getErrorCode(),
|
||||
"Extension encountered error: " + exceptionInfo.getMessage());
|
||||
uasserted(exceptionInfo.getErrorCode(), exceptionInfo.getMessage());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user