@@ -232,6 +232,7 @@ async function tryOperation<
232232 let previousServer : ServerDescription | undefined ;
233233
234234 for ( let tries = 0 ; tries < maxTries ; tries ++ ) {
235+ console . log ( 'trying' , tries , maxTries , willRetry , operation . commandName ) ;
235236 if ( previousOperationError ) {
236237 if ( hasWriteAspect && previousOperationError . code === MMAPv1_RETRY_WRITES_ERROR_CODE ) {
237238 throw new MongoServerError ( {
@@ -248,8 +249,10 @@ async function tryOperation<
248249 if ( hasWriteAspect && ! isRetryableWriteError ( previousOperationError ) )
249250 throw previousOperationError ;
250251
251- if ( hasReadAspect && ! isRetryableReadError ( previousOperationError ) )
252+ if ( hasReadAspect && ! isRetryableReadError ( previousOperationError ) ) {
253+ console . log ( previousOperationError , isRetryableReadError ( previousOperationError ) ) ;
252254 throw previousOperationError ;
255+ }
253256
254257 if (
255258 previousOperationError instanceof MongoNetworkError &&
@@ -280,8 +283,10 @@ async function tryOperation<
280283 if ( tries > 0 && operation . hasAspect ( Aspect . COMMAND_BATCHING ) ) {
281284 operation . resetBatch ( ) ;
282285 }
286+ console . log ( 'executing' , operation . commandName ) ;
283287 return await operation . execute ( server , session , timeoutContext ) ;
284288 } catch ( operationError ) {
289+ console . log ( 'operationError' , operationError ) ;
285290 if ( ! ( operationError instanceof MongoError ) ) throw operationError ;
286291 if (
287292 previousOperationError != null &&
0 commit comments