From 78f2824cc3bd075d21f63933d7b6583bbf52f898 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Thu, 24 Mar 2016 19:51:21 +0000 Subject: [PATCH 1/2] Port rest_client extension from +13004 --- node_modules/c9/rest_client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node_modules/c9/rest_client.js b/node_modules/c9/rest_client.js index 8f42b1d0..8631edf5 100644 --- a/node_modules/c9/rest_client.js +++ b/node_modules/c9/rest_client.js @@ -44,7 +44,11 @@ function RestClient(host, port, config) { port: port, path: path, method: method, - headers: headers + headers: headers, + timeout: config.timeout || 60 * 1000, + pool: config.pool || { + maxSockets: 100000, + }, }; if (config.username) options.auth = config.username + ":" + config.password; From 826dce94f60dc874477dfcf45ccc17d3317fe688 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Thu, 24 Mar 2016 20:33:50 +0000 Subject: [PATCH 2/2] Show error when workspace ceases to exist --- plugins/c9.ide.dialog.common/alert_internal.js | 2 ++ plugins/c9.vfs.client/endpoint.js | 4 ++++ plugins/c9.vfs.client/vfs_client.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/c9.ide.dialog.common/alert_internal.js b/plugins/c9.ide.dialog.common/alert_internal.js index 572c48ad..042b3277 100644 --- a/plugins/c9.ide.dialog.common/alert_internal.js +++ b/plugins/c9.ide.dialog.common/alert_internal.js @@ -42,6 +42,8 @@ define(function(require, module, exports) { .replace(/\n/g, "
") .replace(/(https?:\/\/[^\s]*\b)/g, "$1"); + plugin.getElement("ok").setCaption(options.yes || "OK"); + plugin.update([ { id: "dontshow", visible: options && options.showDontShow } ]); diff --git a/plugins/c9.vfs.client/endpoint.js b/plugins/c9.vfs.client/endpoint.js index c90ff5e3..59197dc9 100644 --- a/plugins/c9.vfs.client/endpoint.js +++ b/plugins/c9.vfs.client/endpoint.js @@ -225,6 +225,10 @@ define(function(require, exports, module) { callback(fatalError(res.error.message, "dashboard")); return; } + else if (err.code == 404) { + callback(fatalError("This workspace no longer appears to exist or failed to be created.", "dashboard")); + return; + } else if (err.code === 428 && res.error) { emit("restore", { projectState: res.error.projectState, diff --git a/plugins/c9.vfs.client/vfs_client.js b/plugins/c9.vfs.client/vfs_client.js index 9e11a4d0..0f07d9b4 100644 --- a/plugins/c9.vfs.client/vfs_client.js +++ b/plugins/c9.vfs.client/vfs_client.js @@ -253,7 +253,7 @@ define(function(require, exports, module) { err.message = "SSH permission denied. Please review your workspace configuration."; return showAlert("Workspace Error", "Unable to access your workspace", err.message, function() { window.location = dashboardUrl; - }); + }, { yes: "Return to dashboard" }); case "reload": lastError = showError(err.message + ". Please reload this window.", -1); setTimeout(function() {