(err: MongoError)
| 967 | } |
| 968 | |
| 969 | function isUnknownTransactionCommitResult(err: MongoError): err is MongoError { |
| 970 | const isNonDeterministicWriteConcernError = |
| 971 | err instanceof MongoServerError && |
| 972 | err.codeName && |
| 973 | NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName); |
| 974 | |
| 975 | return ( |
| 976 | isMaxTimeMSExpiredError(err) || |
| 977 | (!isNonDeterministicWriteConcernError && |
| 978 | err.code !== MONGODB_ERROR_CODES.UnsatisfiableWriteConcern && |
| 979 | err.code !== MONGODB_ERROR_CODES.UnknownReplWriteConcern) |
| 980 | ); |
| 981 | } |
| 982 | |
| 983 | export function maybeClearPinnedConnection( |
| 984 | session: ClientSession, |
no test coverage detected