From d41562a5acf5abf7af5eec0697ab80723486e91e Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 8 Jan 2018 19:06:20 +0400 Subject: [PATCH] fix bridge-service crashing vfs-worker on windows --- plugins/c9.cli.bridge/bridge-service.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/c9.cli.bridge/bridge-service.js b/plugins/c9.cli.bridge/bridge-service.js index 98d2ea6d..b9de2b5e 100644 --- a/plugins/c9.cli.bridge/bridge-service.js +++ b/plugins/c9.cli.bridge/bridge-service.js @@ -21,7 +21,7 @@ module.exports = function (vfs, options, register) { }); client.on("error", function(err) { - if (err.code == "ECONNREFUSED") { + if (err.code == "ECONNREFUSED" && process.platform !== "win32") { require("fs").unlink(SOCKET, function() { createListenServer(api); }); @@ -30,7 +30,7 @@ module.exports = function (vfs, options, register) { createListenServer(api); } else - api.onError(err); + api.onConnectError(err); }); client.on("end", function() { @@ -101,7 +101,7 @@ module.exports = function (vfs, options, register) { }); } else - api.onError(err); + api.onConnectError(err); }); api.disconnect = function() { @@ -134,8 +134,8 @@ module.exports = function (vfs, options, register) { onData: function(data) { stream && stream.emit("data", data); }, - onError: function(err) { - stream && stream.emit("error", err); + onConnectError: function(err) { + callback(err); } };