From 5dc91366039618bb6649c83b0e176ef0a1892d4a Mon Sep 17 00:00:00 2001 From: Reid Burke Date: Mon, 10 Sep 2012 15:52:19 -0700 Subject: [PATCH] Move `var` to the top of the function. --- lib/cli.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index af754e28..df2e4b97 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -293,6 +293,8 @@ function runBatch(options) { // the current agents. client.getAgents(function (err, agents) { + var rl; + if (err) { throw err; } @@ -304,7 +306,7 @@ function runBatch(options) { if (agents.length > 0) { submitBatch(client, batchOptions); } else { - var rl = readline.createInterface(process.stdin, process.stderr); + rl = readline.createInterface(process.stdin, process.stderr); error("Waiting for agents to connect at " + url + ".");