jstests/libs/override_methods/inject_tenant_prefix.js
/**
 * If the given response object contains the given tenant migration error, returns the error object.
 * Otherwise, returns null.
 */
If the given response object contains the given tenant migration error, returns the error object.
Otherwise, returns null.
If the given response object contains the given tenant migration error returns the error object . Otherwise returns null .
function extractTenantMigrationError(resObj, errorCode) {
    if (resObj.code == errorCode) {
        return resObj;
    }
    if (resObj.writeErrors) {
        for (let writeError of resObj.writeErrors) {
            if (writeError.code == errorCode) {
                return writeError;
            }
        }
    }
    return null;
}
function extractTenantMigrationError ( resObj , errorCode ) { if ( resObj . code == errorCode ) { return resObj ; } if ( resObj . writeErrors ) { for ( let writeError of resObj . writeErrors ) { if ( writeError . code == errorCode ) { return writeError ; } } } return null ; }
If the given response object contains the given tenant migration error, returns the error object.
If the given response object contains the given tenant migration error returns the error object .
// Commands, like createIndex and dropIndex, have TenantMigrationCommitted or // TenantMigrationAborted error in the top level.