summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-10-07 16:09:08 -0700
committerRider Linden <rider@lindenlab.com>2015-10-07 16:09:08 -0700
commit1356be0fe9e15c8205e660e491185827d74bcb07 (patch)
treed0621c24f74f316b803e067ce1d6815367efdc00 /indra/newview
parent8974f7e1133232699dcc743eafbfcc8209988104 (diff)
MAINT-5691: Browser was using deprecated outbox display type AND not correctly returning error body to application.
LLCore:HTTP now will provide and LLSD translation of the message body when possible in the case of an error HTTP result VMM alert boxes now use type="alertmodal" rather than "outbox"
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llappearancemgr.cpp15
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp41
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml22
3 files changed, 42 insertions, 36 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 720a4ff2df..025009d40b 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -3440,21 +3440,6 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro()
if (!status || !result["success"].asBoolean())
{
- if (httpResults.has("error_body"))
- {
- std::istringstream bodystream(httpResults["error_body"].asStringRef());
- LLSD body_llsd;
-
- if (LLSDSerialize::fromXML(body_llsd, bodystream, true) == LLSDParser::PARSE_FAILURE)
- {
- LL_WARNS() << "Unable to parse body as LLSD" << LL_ENDL;
- }
- else
- {
- result = body_llsd;
- }
- }
-
std::string message = (result.has("error")) ? result["error"].asString() : status.toString();
LL_WARNS("Avatar") << "Appearance Failure. server responded with \"" << message << "\"" << LL_ENDL;
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index e8e56ef0cd..dfa33b37ef 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -106,10 +106,13 @@ namespace {
///////////////////////////////////////////////////////////////////////////////
// SLM Reporters
- void log_SLM_warning(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description)
+ void log_SLM_warning(const std::string& request, U32 status, const std::string& reason, const std::string& code, const LLSD& result)
{
- LL_WARNS("SLM") << "SLM API : Responder to " << request << ". status : " << status << ", reason : " << reason << ", code : " << code << ", description : " << description << LL_ENDL;
- if ((status == 422) && (description == "[\"You must have an English description to list the product\", \"You must choose a category for your product before it can be listed\", \"Listing could not change state.\", \"Price can't be blank\"]"))
+
+ LL_WARNS("SLM") << "SLM API : Responder to " << request << ". status : " << status << ", reason : " << reason << ", code : " << code << ", description : " << ll_pretty_print_sd(result) << LL_ENDL;
+ if ((status == 422) && (result.has(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_CONTENT) &&
+ result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_CONTENT].isArray() &&
+ result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_CONTENT].size() > 4))
{
// Unprocessable Entity : Special case that error as it is a frequent answer when trying to list an incomplete listing
LLNotificationsUtil::add("MerchantUnprocessableEntity");
@@ -120,14 +123,32 @@ namespace {
LLSD subs;
subs["[ERROR_REASON]"] = reason;
// We do show long descriptions in the alert (unlikely to be readable). The description string will be in the log though.
- subs["[ERROR_DESCRIPTION]"] = (description.length() <= 512 ? description : "");
+ std::string description;
+ if (result.has(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_CONTENT))
+ {
+ LLSD content = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_CONTENT];
+ if (content.isArray())
+ {
+ for (LLSD::array_iterator it = content.beginArray(); it != content.endArray(); ++it)
+ {
+ if (!description.empty())
+ description += "\n";
+ description += (*it).asString();
+ }
+ }
+ else
+ {
+ description = content.asString();
+ }
+ }
+ else
+ {
+ description = result.asString();
+ }
+ subs["[ERROR_DESCRIPTION]"] = description;
LLNotificationsUtil::add("MerchantTransactionFailed", subs);
}
- }
- void log_SLM_warning(const std::string& request, U32 status, const std::string& reason, const std::string& code, const LLSD& description)
- {
- log_SLM_warning(request, status, reason, code, std::string(ll_pretty_print_sd(description)));
}
void log_SLM_infos(const std::string& request, U32 status, const std::string& body)
@@ -777,8 +798,8 @@ void LLMarketplaceData::getMerchantStatusCoro()
else
{
std::string err_code = result["error_code"].asString();
- std::string err_description = result["error_description"].asString();
- log_SLM_warning("Get /merchant", httpCode, status.toString(), err_code, err_description);
+ //std::string err_description = result["error_description"].asString();
+ log_SLM_warning("Get /merchant", httpCode, status.toString(), err_code, result["error_description"]);
setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE);
}
return;
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index f847c73287..66b52c586f 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -244,7 +244,7 @@ You don't have permission to copy one or more of these items to the Merchant Out
<notification
icon="OutboxStatus_Success"
name="OutboxFolderCreated"
- type="outbox">
+ type="alertmodal">
<unique/>
A new folder has been created for each item you have transferred into the top level of your Merchant Outbox.
@@ -257,7 +257,7 @@ A new folder has been created for each item you have transferred into the top le
<notification
icon="OutboxStatus_Success"
name="OutboxImportComplete"
- type="outbox">
+ type="alertmodal">
Success
All folders were successfully sent to the Marketplace.
@@ -271,7 +271,7 @@ All folders were successfully sent to the Marketplace.
<notification
icon="OutboxStatus_Warning"
name="OutboxImportHadErrors"
- type="outbox">
+ type="alertmodal">
Some folders did not transfer
Errors occurred when some folders were sent to the Marketplace. Those folders are still in your Merchant Outbox.
@@ -286,7 +286,7 @@ See the [[MARKETPLACE_IMPORTS_URL] error log] for more information.
<notification
icon="OutboxStatus_Error"
name="OutboxImportFailed"
- type="outbox">
+ type="alertmodal">
Transfer failed with error &apos;[ERROR_CODE]&apos;
No folders were sent to the Marketplace because of a system or network error. Try again later.
@@ -299,7 +299,7 @@ No folders were sent to the Marketplace because of a system or network error. T
<notification
icon="OutboxStatus_Error"
name="OutboxInitFailed"
- type="outbox">
+ type="alertmodal">
Marketplace initialization failed with error &apos;[ERROR_CODE]&apos;
Initialization with the Marketplace failed because of a system or network error. Try again later.
@@ -312,7 +312,7 @@ Initialization with the Marketplace failed because of a system or network error.
<notification
icon="OutboxStatus_Error"
name="StockPasteFailed"
- type="outbox">
+ type="alertmodal">
Copy or move to Stock Folder failed with error :
&apos;[ERROR_CODE]&apos;
@@ -325,7 +325,7 @@ Initialization with the Marketplace failed because of a system or network error.
<notification
icon="OutboxStatus_Error"
name="MerchantPasteFailed"
- type="outbox">
+ type="alertmodal">
Copy or move to Marketplace Listings failed with error :
&apos;[ERROR_CODE]&apos;
@@ -338,7 +338,7 @@ Initialization with the Marketplace failed because of a system or network error.
<notification
icon="OutboxStatus_Error"
name="MerchantTransactionFailed"
- type="outbox">
+ type="alertmodal">
The transaction with the Marketplace failed with the following error :
Reason : &apos;[ERROR_REASON]&apos;
@@ -352,7 +352,7 @@ Initialization with the Marketplace failed because of a system or network error.
<notification
icon="OutboxStatus_Error"
name="MerchantUnprocessableEntity"
- type="outbox">
+ type="alertmodal">
We are unable to list this product or activate the version folder. Usually this is caused by missing information in the listing description form, but it may be due to errors in the folder structure. Either edit the listing or check the listing folder for errors.
<usetemplate
@@ -363,7 +363,7 @@ Initialization with the Marketplace failed because of a system or network error.
<notification
icon="OutboxStatus_Error"
name="MerchantListingFailed"
- type="outbox">
+ type="alertmodal">
Listing to Marketplace failed with error :
&apos;[ERROR_CODE]&apos;
@@ -376,7 +376,7 @@ Initialization with the Marketplace failed because of a system or network error.
<notification
icon="OutboxStatus_Error"
name="MerchantFolderActivationFailed"
- type="outbox">
+ type="alertmodal">
Activating this version folder failed with error :
&apos;[ERROR_CODE]&apos;