From 180dfca03f61e1cdda6260624b5258f33996d0de Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 7 Dec 2010 11:29:10 -0800 Subject: [PATCH] Pretty error message messes up if readFileSync in main module fails. TODO test/message test for this. --- src/node.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/node.js b/src/node.js index d83089f7c4..334d8c5ee5 100644 --- a/src/node.js +++ b/src/node.js @@ -379,16 +379,7 @@ exports.runMain = function() { // Load the main module--the command line argument. process.mainModule = new Module('.'); - try { - 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; - } - } + process.mainModule.load(process.argv[1]); }; // bootstrap repl