From 1d7cab3a3c99d39baeda2f276f985210603e7141 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Mon, 5 Oct 2015 14:40:27 +0000 Subject: [PATCH 1/2] white list error keys fixes https://trello.com/c/UpvPmchx/5-workspace-creation-shows-hibernate-or-migrate-screen --- plugins/c9.error/error_handler.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/c9.error/error_handler.js b/plugins/c9.error/error_handler.js index f2b8024a..fc2edd7d 100644 --- a/plugins/c9.error/error_handler.js +++ b/plugins/c9.error/error_handler.js @@ -118,8 +118,18 @@ function plugin(options, imports, register) { message: err.message, hostname: options.hostname, scope: options.scope, - stack: stack, + stack: stack }; + + var allowedErrorKeys = [ + "message", "projectState", "premium", "retryIn", "progress", + "oldHost", "blocked" + ]; + + allowedErrorKeys.forEach(function(key) { + if (err.hasOwnProperty(key)) + error[key] = err[key]; + }); try { JSON.stringify(error); From 32af0fdb7b2b6dccfa974acb6dc46f44f9f2068d Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Mon, 5 Oct 2015 14:43:31 +0000 Subject: [PATCH 2/2] cleanup --- plugins/c9.error/error_handler.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/c9.error/error_handler.js b/plugins/c9.error/error_handler.js index fc2edd7d..29f4a9d4 100644 --- a/plugins/c9.error/error_handler.js +++ b/plugins/c9.error/error_handler.js @@ -115,14 +115,13 @@ function plugin(options, imports, register) { if (/json/.test(accept)) { var error = { code: statusCode, - message: err.message, hostname: options.hostname, scope: options.scope, stack: stack }; var allowedErrorKeys = [ - "message", "projectState", "premium", "retryIn", "progress", + "message", "projectState", "premium", "retryIn", "progress", "oldHost", "blocked" ];