diff options
author | Matt Godbolt <matt@godbolt.org> | 2016-08-06 15:50:06 -0500 |
---|---|---|
committer | Matt Godbolt <matt@godbolt.org> | 2016-08-06 15:50:06 -0500 |
commit | dc57abaa7476d7d36b1abd013d6a1568c8694129 (patch) | |
tree | 4ad488f1c32c8906cc5d2dd5ca607202a7821438 /lib/diff.js | |
parent | f585fd6fc6ec87379605ffb4335ccf7b15bf853b (diff) | |
download | compiler-explorer-dc57abaa7476d7d36b1abd013d6a1568c8694129.tar.gz compiler-explorer-dc57abaa7476d7d36b1abd013d6a1568c8694129.zip |
Better errors if diff fails
Diffstat (limited to 'lib/diff.js')
-rw-r--r-- | lib/diff.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/diff.js b/lib/diff.js index c6c31cacb..3123929a4 100644 --- a/lib/diff.js +++ b/lib/diff.js @@ -190,7 +190,7 @@ function buildDiffHandler(config) { stdout += "\n[Truncated]"; truncated = true; child.kill(); - return; + resolve(stdout); } stdout += data; }); @@ -198,7 +198,7 @@ function buildDiffHandler(config) { child.on('error', function (e) { reject(e); }); - child.on('exit', function (code) { + child.on('exit', function () { resolve(stdout); }); }); @@ -219,7 +219,10 @@ function buildDiffHandler(config) { } }) .catch(function (err) { - res.error(err); + res.end(JSON.stringify({ + computedDiff: "Failed to diff: " + err, + zones: null + })); }); }; } |