From 3b593c9ec5d526991a9a60844b1e66597989d280 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 8 Sep 2011 16:03:48 +0700 Subject: [PATCH] [debugger] handle lookup error, no more need to handle SyntaxErrors --- lib/_debugger.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/_debugger.js b/lib/_debugger.js index ae11d236c..904021d73 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -283,6 +283,8 @@ Client.prototype.reqScopes = function(cb) { }); self.reqLookup(refs, function(res) { + if (!res.success) return cb(Error(res.message) || true) + var globals = Object.keys(res.body).map(function(key) { return res.body[key].properties.map(function(prop) { return prop.name; @@ -751,11 +753,7 @@ Interface.prototype.debugEval = function(code, context, filename, callback) { client.reqEval(code, function(res) { if (!res.success) { if (res.message) { - if (/SyntaxError/.test(res.message)) { - callback(new SyntaxError(res.message)); - } else { - callback(new Error(res.message)); - } + callback(res.message); } else { callback(null); } -- 2.34.1