From b0c0582e417a6852bb79b1ee915112fc11aaa2dc Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Jun 2016 11:59:11 +0300 Subject: [PATCH 1/2] Fix: default vale for parameters should be [] and not {} --- rd_ui/app/scripts/services/resources.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rd_ui/app/scripts/services/resources.js b/rd_ui/app/scripts/services/resources.js index 030e56abb4..526ac8a4fe 100644 --- a/rd_ui/app/scripts/services/resources.js +++ b/rd_ui/app/scripts/services/resources.js @@ -586,7 +586,7 @@ this.cachedQueryText = this.query.query; var parameterNames = this.parseQuery(); - this.query.options.parameters = this.query.options.parameters || {}; + this.query.options.parameters = this.query.options.parameters || []; var parametersMap = {}; _.each(this.query.options.parameters, function(param) { From e18a073128d5b25dbeb5447f5c0d61c9a337db43 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Jun 2016 12:12:28 +0300 Subject: [PATCH 2/2] Show error when failing to communicate with server Closes #949. --- rd_ui/app/scripts/services/resources.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rd_ui/app/scripts/services/resources.js b/rd_ui/app/scripts/services/resources.js index 526ac8a4fe..4ffd465635 100644 --- a/rd_ui/app/scripts/services/resources.js +++ b/rd_ui/app/scripts/services/resources.js @@ -377,7 +377,10 @@ refreshStatus(queryResult, query); }, 3000); } - }) + }, function(error) { + console.log("Connection error", error); + queryResult.update({job: {error: 'failed communicating with server. Please check your Internet connection and try again.', status: 4}}) + }); } QueryResult.getById = function (id) { @@ -413,6 +416,9 @@ queryResult.update(error.data); } else if (error.status === 400 && 'job' in error.data) { queryResult.update(error.data); + } else { + console.log("Unknown error", error); + queryResult.update({job: {error: 'unknown error occurred. Please try again later.', status: 4}}) } });