Browse Source

Pretty error message messes up if readFileSync in main module fails.

TODO test/message test for this.
v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
180dfca03f
  1. 11
      src/node.js

11
src/node.js

@ -379,16 +379,7 @@
exports.runMain = function() { exports.runMain = function() {
// Load the main module--the command line argument. // Load the main module--the command line argument.
process.mainModule = new Module('.'); process.mainModule = new Module('.');
try { process.mainModule.load(process.argv[1]);
process.mainModule.load(process.argv[1]);
} catch (e) {
if (e.errno == lazyConstants().ENOENT) {
console.error("Cannot load '%s'", process.argv[1]);
process.exit(1);
} else {
throw e;
}
}
}; };
// bootstrap repl // bootstrap repl

Loading…
Cancel
Save