jstests/libs/override_methods/network_error_and_txn_override.js
// Returns true if any error code in a response's "raw" field is retryable.
Returns true if any error code in a response's "raw" field is retryable.
Returns true if any error code in a response ' s " raw " field is retryable .
function rawResponseHasRetryableError(rawRes, cmdName, logError) {
    for (let shard in rawRes) {
        const shardRes = rawRes[shard];
        const logShardError = (msg) => {
            const msgWithShardPrefix = `Processing raw response from shard: ${shard} :: ${msg}`;
            logError(msgWithShardPrefix);
        };
        const networkRetryShardRes = shouldRetryWithNetworkErrorOverride(
            shardRes, cmdName, logShardError, false );
        if (networkRetryShardRes === kContinue) {
            return true;
        }
    }
    return false;
}
function rawResponseHasRetryableError ( rawRes , cmdName , logError ) { for ( let shard in rawRes ) { const shardRes = rawRes [ shard ] ; const logShardError = ( msg ) => { const msgWithShardPrefix = ` ${ shard } ${ msg } ` ; logError ( msgWithShardPrefix ) ; } ; const networkRetryShardRes = shouldRetryWithNetworkErrorOverride ( shardRes , cmdName , logShardError , false ) ; if ( networkRetryShardRes === kContinue ) { return true ; } } return false ; }
Returns true if any error code in a response's "raw" field is retryable.
Returns true if any error code in a response ' s " raw " field is retryable .
// Don't override the responses from each shard because only the top-level code in a // response is used to determine if a command succeeded or not. /* shouldOverrideAcceptableError */