From 592cfc6b7339e197b50796ccef14e708e6fe6bef Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 4 Feb 2011 11:11:28 -0800 Subject: [PATCH] Authorize Security Group Rule, Download Template, Download ISO action - change UI to show error text (English, non-localized) instead of error code(530, 531) when API call returns error. --- ui/scripts/cloud.core.iso.js | 3 ++- ui/scripts/cloud.core.securitygroup.js | 4 ++-- ui/scripts/cloud.core.template.js | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/scripts/cloud.core.iso.js b/ui/scripts/cloud.core.iso.js index 75e593e2dd7..819f26e340e 100644 --- a/ui/scripts/cloud.core.iso.js +++ b/ui/scripts/cloud.core.iso.js @@ -732,7 +732,8 @@ function doDownloadISO($actionLink, $detailsTab, $midmenuItem1) { $infoContainer.find("#info").html(htmlMsg2); $infoContainer.show(); } else if (result.jobstatus == 2) { // Failed - var errorMsg = g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode); + //var errorMsg = g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode); + var errorMsg = g_dictionary["label.failed"] + " - " + fromdb(result.jobresult.errortext); handleErrorInDialog2(errorMsg, $dialogDownloadISO); } } diff --git a/ui/scripts/cloud.core.securitygroup.js b/ui/scripts/cloud.core.securitygroup.js index 154af4cdf01..e159664b1f7 100644 --- a/ui/scripts/cloud.core.securitygroup.js +++ b/ui/scripts/cloud.core.securitygroup.js @@ -309,8 +309,8 @@ function initAddIngressRuleDialog() { } } } else if (result.jobstatus == 2) { // Failed - //var errorMsg = fromdb(result.jobresult.errortext); - var errorMsg = g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode); + //var errorMsg = g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode); + var errorMsg = g_dictionary["label.failed"] + " - " + fromdb(result.jobresult.errortext); handleErrorInDialog2(errorMsg, $thisDialog); } } diff --git a/ui/scripts/cloud.core.template.js b/ui/scripts/cloud.core.template.js index 71c3c71f01c..92db75dd70d 100644 --- a/ui/scripts/cloud.core.template.js +++ b/ui/scripts/cloud.core.template.js @@ -766,7 +766,8 @@ function doDownloadTemplate($actionLink, $detailsTab, $midmenuItem1) { $infoContainer.find("#info").html(htmlMsg2); $infoContainer.show(); } else if (result.jobstatus == 2) { // Failed - var errorMsg = g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode); + //var errorMsg = g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode); + var errorMsg = g_dictionary["label.failed"] + " - " + fromdb(result.jobresult.errortext); handleErrorInDialog2(errorMsg, $dialogDownloadTemplate); } }