lib/helpers/errors.js
function createTooManyRedirectsErr(opts, req) {
    assert.object(opts, 'opts');
    assert.object(req, 'req');

    var errInfo = createErrInfo(opts, req);
    var errMsg = [
        'aborted',
        opts.method,
        'request to',
        errInfo.fullUrl,
        'after',
        opts.redirects,
        'redirects'
    ].join(' ');

    return new ERR_CTOR.TooManyRedirectsError({
        info: _.assign(errInfo, {
            // add additional context relevant for redirects
            numRedirects: opts.redirects,
            maxRedirects: opts.maxRedirects
        })
    }, '%s', errMsg);
}
function createTooManyRedirectsErr(opts, req) {
    assert.object(opts, 'opts');
    assert.object(req, 'req');

    var errInfo = createErrInfo(opts, req);
    var errMsg = [
        'aborted',
        opts.method,
        'request to',
        errInfo.fullUrl,
        'after',
        opts.redirects,
        'redirects'
    ].join(' ');

    return new ERR_CTOR.TooManyRedirectsError({
        info: _.assign(errInfo, {
            // add additional context relevant for redirects
            numRedirects: opts.redirects,
            maxRedirects: opts.maxRedirects
        })
    }, '%s', errMsg);
}
function createTooManyRedirectsErr ( opts , req ) { assert . object ( opts , 'opts' ) ; assert . object ( req , 'req' ) ; var errInfo = createErrInfo ( opts , req ) ; var errMsg = [ 'aborted' , opts . method , 'request to' , errInfo . fullUrl , 'after' , opts . redirects , 'redirects' ] . join ( ' ' ) ; return new ERR_CTOR . TooManyRedirectsError ( { info : _ . assign ( errInfo , { // add additional context relevant for redirects numRedirects : opts . redirects , maxRedirects : opts . maxRedirects } ) } , '%s' , errMsg ) ; }
build a redirect error for a request that encountered too many redirects
when attempting to follow redirects.
@private
@function createRequestTimeoutErr
@param {Object} opts options object for a request
@param {Object} req the request object
@returns {verror.VError} RequestTimeoutError
build a redirect error for a request that encountered too many redirects when attempting to follow redirects .