From d1e9c348f7ccf39559e602aa0b95e1b58cec0d96 Mon Sep 17 00:00:00 2001 From: Lloyd Hilaiel <lloyd@hilaiel.com> Date: Tue, 12 Apr 2011 19:07:05 -0600 Subject: [PATCH] don't write an error to console if run.js for the particular server doesn't exist (not an error) --- run.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/run.js b/run.js index 68985a745..7c5f4fe45 100644 --- a/run.js +++ b/run.js @@ -132,10 +132,13 @@ dirs.forEach(function(dirObj) { var handlerPath = path.join(dirObj.path, "server", "run.js"); var handler = undefined; try { - fs.statSync(handlerPath).isFile(); - handler = require(handlerPath).handler; + var runJSExists = false; + try { runJSExists = fs.statSync(handlerPath).isFile() } catch(e) {}; + if (runJSExists) { + handler = require(handlerPath).handler; + } } catch(e) { - console.log("Error starting up " + dirObj + ": " + e); + console.log("Error loading " + handlerPath + ": " + e); } var so = { -- GitLab