INNER CODE UNIT · JavaScript

errorMockingRequire

phusion/passenger · src/helper-scripts/node-loader.js:42

function errorMockingRequire(packageName, error, args, count) {
	if (count > 2) {
		return; // spam protect against repeated warnings
	}
	var msg = "Failed to install shim to guard against the " + packageName + ". Due to: " + error.message + ". Your can safely ignore this warning if you are not using " + packageName;
	msg += "\n\tNode version: " + process.version + "\tArguments: " + args.length;
	for (i = 0; i < args.length; i++) {
		if (i > 9) { // limit the amount of array elements we log
			break;
		}
		msg += "\n\t[" + i + "] " + util.inspect(args[i]).substr(0, 200); // limit the characters per array element
	};
	console.error(msg);
}

//Mock out Node Cluster Module
var Module = require('module');
var originalRequire = Module.prototype.require;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…