`InternalOAuthError` error.

InternalOAuthError wraps errors generated by node-oauth.  By wrapping these
objects, error messages can be formatted in a manner that aids in debugging
OAuth issues.

@api public
198462
function InternalOAuthError(message, err) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'InternalOAuthError';
  this.message = message;
  this.oauthError = err;
}
1344891
function errHandler(err, req, res, next) {
  console.log(addTimestamp("Internal error: " + util.inspect(err)));
  console.error(addTimestamp("Internal error: " + util.inspect(err)));
  if (err && err.stack) {
    console.error(err.stack);
  }

  var errorMessage = {
    msg: 'Internal error: ' + util.inspect(err),
    error: util.inspect(err)
  };
  if (res) {
    res.statusCode = 500;
    res.end(JSON.stringify(errorMessage));
  }

  return errorMessage;
}
487207
function InternalServerError(message, cause) {
    InternalServerError.super_.call(this, message, StatusCode.INTERNAL_SERVER_ERROR, cause);
}
1283589
def authorization_error_class(response):
    
    message = response.headers.get("www-authenticate")
    if message:
        error = message.replace('"', "").rsplit("=", 1)[1]
    else:
        error = response.status_code
    return _auth_error_mapping[error](response)
863947
function SigningError(cause) {
    this.code = 'SigningError';
    assert.optionalObject(cause);
    var msg = 'error signing request';
    var args = (cause ? [cause, msg] : [msg]);
    WError.apply(this, args);
}
3894
function AccessDeniedError(message, innerMessage, model) {
    AccessDeniedError.super_.bind(this)('EACCESS', ('Access Denied' || message) , innerMessage, model);
    this.statusCode = 401;
}
117161
function InvalidSourceError(error) {
    var instance = new Error("An exception was thrown when making a request.");

    instance.name = "InvalidSourceError";
    instance.innerError = error;

    if (Object.setPrototypeOf) {
        Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
    }

    if (Error.captureStackTrace) {
        Error.captureStackTrace(instance, InvalidSourceError);
    }

    return instance;
}
901643
async function log(err, auth) {
    if (err.print) {
        console.log(err.message);
    }

    try {
        err = JSON.parse(JSON.stringify(err, Reflect.ownKeys(err)));
    } catch (error) {
        err = err;
    }

    let userId = 'unknown';
    try {
        await firebaseJs.authWithFirebase(auth);
        userId = firebase.auth().currentUser.uid;
    } catch (error) {}

    try {
        let version = 'unkown';
        if (pjson.version) {
            version = pjson.version.replace(/\./g, '_');
        }

        const requestData = {
            userId,
            version,
            err,
            timestamp: {
                ".sv": "timestamp",
            },
        };

        const result = await request({
            url: `${constants.FIREBASE_DATABASE_URL}/logs/errors/${version}/${userId}.json`,
            method: "POST",
            json: true,
            headers: {
                "content-type": "application/json",
            },
            body: requestData,
        });
        // console.log(`Error logged: ${result.name}`);
    } catch (error) {}
    return;
}
137879
function checkError(method,res) {
    var descriptions = {
        200:	'Success',
        201:	'Success - new resource created (POST)',
        204:	'Success - no content to return (DELETE)',
        400:	'Bad Request - request couldn\'t be parsed',
        401:	'Unauthorized - OAuth must be provided',
        403:	'Forbidden - invalid API key or unapproved app',
        404:	'Not Found - method exists, but no record found',
        405:	'Method Not Found - method doesn\'t exist',
        409:	'Conflict - resource already created',
        412:	'Precondition Failed - use application/json content type',
        422:	'Unprocessable Entity - validation errors',
        429:	'Rate Limit Exceeded',
        500:	'Server Error',
        503:	'Service Unavailable - server overloaded',
        520:	'Service Unavailable - Cloudflare error',
        521:	'Service Unavailable - Cloudflare error',
        522:	'Service Unavailable - Cloudflare error '  
    }
    if (CODEOK[(method).toUpperCase()].indexOf(res.statusCode)>=0) {
        return null;
    }
    var e = new Error('trakter: ' + descriptions[res.statusCode]);
    e.name = 'TrakterBadResponse';
    e.code = res.statusCode
    return e;
}
631641
function httpInternalError(req, res, err) {
    console.error(err);
    res.writeHead(500, { 'Content-Type': 'text/plain' });
    res.write(`Error 500 Internal server error: ${err}`);
    res.end();
}
1311055
function initErrorHandler (config) {
    // add error handler
    config.express.use(function(error, req, res, next) {
        // error must be object with stack
        if (typeof error !== 'object' || typeof error.stack !== 'string') {
            error = new Error(error)
        }
        // whether or not response will be JSON
        var json = req.query.json === '1' || req.query.json === 'true' || (req.xhr && req.query.json !== '0' && req.query.json !== 'false') ? true : false
        // set clean stack
        if (defined(stackUtils)) {
            error.stack = stackUtils.clean(error.stack)
        }
        // if error contains cookies then set cookies with response
        if (error.cookies) {
            // set cookies
            _.each(error.cookies, (value, name) => {
                setCookie(name, res, value)
            })
        }
        // get http code from error code
        var code = error.code
        // if code is not between 300 and 500 then set to 500
        if (!(code >= 300 && code <= 500)) {
            code = error.code = 500
        }
        // json response is expected
        if (json) {
            // code is for redirect
            if (code === 301 || code === 302) {
                res.json({
                    code: code,
                    redirect: true,
                    url: error.url,
                })
            }
            // if error is 409 conflict data should be current instance
            else if (code === 409) {
                // set http status code
                res.status(code)
                // send current instance data
                res.json(error.data)
            }
            // code is other error
            else {
                // get message
                var message = error.message || 'Unknown error'
                // build response
                var resData = {
                    error: message,
                    code: code,
                    data: error.data,
                }
                // add stack if in dev
                if (!isProd) {
                    resData.stack = error.stack.split('\n')
                    // remove last element from stack which is empty
                    resData.stack.pop()
                }
                // set http status code
                res.status(code)
                // send current instance data
                res.json(resData)
            }
        }
        // html response is expected
        else {
            // code is for redirect
            if (code === 301 || code === 302) {
                res.redirect(code, error.url)
            }
            // code is error
            else {
                // set http status code
                res.status(code)
                // create pretty printed json data
                if (error.data) {
                    error.prettyData = JSON.stringify(error.data, null, 4)
                }
                // build data for error template
                var data = {
                    error: error,
                    production: isProd,
                    session: req.session,
                }
                // add assets to template data
                _.merge(data, config.assets)
                // render error page
                res.render('error', data)
            }
        }
    })
}
751581
function (error) {
		if (error) {
			var err = new Error(error.toString());
			err.name = "l_createToken Error";
			UTIL.safeCall(onDone, err);
		}
		else {
			LOG.warn('pass_token [' + token + '] stored');
			UTIL.safeCall(onDone, null, token);			
		}
	}
683914
def internal_error (out=stderr, etype=None, evalue=None, tb=None):
    """"""
    print(os.linesep, file=out)
    print(_("""********** Oops, I did it again. *************

You have found an internal error in LinkChecker. Please write a bug report
at %s
and include the following information:
- the URL or file you are testing
- the system information below

When using the commandline client:
- your commandline arguments and any custom configuration files.
- the output of a debug run with option "-Dall"

Not disclosing some of the information above due to privacy reasons is ok.
I will try to help you nonetheless, but you have to give me something
I can work with ;) .
""") % configuration.SupportUrl, file=out)
    if etype is None:
        etype = sys.exc_info()[0]
    if evalue is None:
        evalue = sys.exc_info()[1]
    if tb is None:
        tb = sys.exc_info()[2]
    better_exchook2.better_exchook(etype, evalue, tb, out=out)
    print_app_info(out=out)
    print_proxy_info(out=out)
    print_locale_info(out=out)
    print(os.linesep,
      _("******** LinkChecker internal error, over and out ********"), file=out)
195178
function ErrorStackParser$$parseOpera11(error) {
	            var filtered = _filter(error.stack.split('\n'), function (line) {
	                return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&
	                    !line.match(/^Error created at/);
	            }, this);
	
	            return _map(filtered, function (line) {
	                var tokens = line.split('@');
	                var locationParts = this.extractLocation(tokens.pop());
	                var functionCall = (tokens.shift() || '');
	                var functionName = functionCall
	                        .replace(/<anonymous function(: (\w+))?>/, '$2')
	                        .replace(/\([^\)]*\)/g, '') || undefined;
	                var argsRaw;
	                if (functionCall.match(/\(([^\)]*)\)/)) {
	                    argsRaw = functionCall.replace(/^[^\(]+\(([^\)]*)\)$/, '$1');
	                }
	                var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');
	                return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);
	            }, this);
	        }
287759
function ProviderAuthError (options, status) {
  if (!status) {
    switch (options.error) {
      case 'access_denied': status = 403
        break
      case 'server_error': status = 502
        break
      case 'temporarily_unavailable': status = 503
        break
    }
  }

  this.name = 'ProviderAuthError'
  this.code = options.error || 'server_error'
  this.message = options.error_description
  this.status = status || 500
}
23193
function defaultTransformError(err,req){
    let body = {
        code: err.code,
        message: err.message,
        data: err.data,
    }

    if (req._expressDeliverOptions.printErrorStack===true){
        body.stack = err.stack
    }

    if (err.name == 'InternalError' && req._expressDeliverOptions.printInternalErrorData!==true){
        delete body.data
    }

    return {
        status:false,
        error:body
    }
}
38873
function responseErrorBuilder(err, res) {
  if (res && res.body && _.isObject(res.body) && res.body.error) {
    // pass through error obj from API
    return res.body;
  } else {
    // build custom error
    return {
      error: {
        code: err.status || CL_CONSTANTS.RES_UNKNOWN,
        message: (res ? res.text : null) || err.toString(),
      }
    };
  }
}