Skip to content

Commit 22caa48

Browse files
committed
chore: comments
1 parent 4b8c7d4 commit 22caa48

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/connection_string.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,14 @@ export function parseOptions(
426426
if (isAws) {
427427
const { username, password } = mongoOptions.credentials;
428428
if (username || password) {
429-
throw new MongoParseError(
430-
'username and password cannot be provided when using MONGODB-AWS'
429+
throw new MongoAPIError(
430+
'username and password cannot be provided when using MONGODB-AWS. Credentials must be read via the AWS SDK'
431431
);
432432
}
433433
if (mongoOptions.credentials.mechanismProperties.AWS_SESSION_TOKEN) {
434-
throw new MongoParseError('AWS_SESSION_TOKEN cannot be provided when using MONGODB-AWS');
434+
throw new MongoAPIError(
435+
'AWS_SESSION_TOKEN cannot be provided when using MONGODB-AWS. Credentials must be read via the AWS SDK'
436+
);
435437
}
436438
}
437439

test/unit/assorted/auth.spec.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { loadSpecTests } from '../../spec';
22
import { executeUriValidationTest } from '../../tools/uri_spec_runner';
33

44
const SKIP = [
5-
'should throw an exception if username and no password (MONGODB-AWS)',
65
'should use username and password if specified (MONGODB-AWS)',
76
'should use username, password and session token if specified (MONGODB-AWS)'
87
];
@@ -15,7 +14,7 @@ describe('Auth option spec tests (legacy)', function () {
1514
for (const test of suite.tests) {
1615
it(`${test.description}`, function () {
1716
if (SKIP.includes(test.description)) {
18-
this.test.skipReason = `NODE-7046: ${test.description}`;
17+
this.test.skipReason = `NODE-7228: ${test.description}`;
1918
this.test.skip();
2019
}
2120
executeUriValidationTest(test);

0 commit comments

Comments
 (0)