Skip to content

Commit 34389d1

Browse files
committed
refactor: Add comments to mark needed changes
1 parent 410f11d commit 34389d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/operations/execute_operation.ts

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function executeOperation<
8686
owner = Symbol();
8787
session = topology.startSession({ owner, explicit: false });
8888
} else if (session.hasEnded) {
89+
// TODO: Change this out for MongoExpiredSessionError
8990
return cb(new MongoDriverError('Use of expired sessions is not permitted'));
9091
}
9192
} else if (session) {
@@ -127,6 +128,7 @@ function executeWithServerSelection(
127128

128129
if (inTransaction && !readPreference.equals(ReadPreference.primary)) {
129130
callback(
131+
// TODO: Change this out for MongoTransactionError
130132
new MongoDriverError(
131133
`Read preference in a transaction must be primary, not: ${readPreference.mode}`
132134
)
@@ -188,6 +190,7 @@ function executeWithServerSelection(
188190
session.inTransaction()
189191
) {
190192
callback(
193+
// TODO: Change this out for MongoTransactionError
191194
new MongoDriverError(
192195
`Read preference in a transaction must be primary, not: ${readPreference.mode}`
193196
)

0 commit comments

Comments
 (0)