summaryrefslogtreecommitdiff
path: root/indra/newview/llaisapi.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-09 12:52:17 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-09 12:52:17 +0300
commit8e1c5fee2b9c329eef9be503af740894aac27635 (patch)
treeb22ba86526eb42dcd0be5ff66bda360c5a4a0369 /indra/newview/llaisapi.cpp
parentce0300e9668318d061046e309ae0e0b618b8a099 (diff)
SL-18629 Better item fetch error handling
Diffstat (limited to 'indra/newview/llaisapi.cpp')
-rw-r--r--indra/newview/llaisapi.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 0f58908251..4546574955 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -986,6 +986,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
case FETCHITEM:
if (result.has("item_id"))
{
+ // Error message might contain an item_id!!!
id = result["item_id"];
}
if (result.has("linked_id"))
@@ -1167,11 +1168,15 @@ void AISUpdate::parseMeta(const LLSD& update)
void AISUpdate::parseContent(const LLSD& update)
{
- if (update.has("linked_id"))
+ // Errors from a fetch request might contain id without
+ // full item or folder.
+ // Todo: Depending on error we might want to do something,
+ // like removing a 404 item or refetching parent folder
+ if (update.has("linked_id") && update.has("parent_id"))
{
parseLink(update, mFetchDepth);
}
- else if (update.has("item_id"))
+ else if (update.has("item_id") && update.has("parent_id"))
{
parseItem(update);
}
@@ -1185,7 +1190,7 @@ void AISUpdate::parseContent(const LLSD& update)
parseEmbedded(update["_embedded"], mFetchDepth - 1);
}
}
- else if (update.has("category_id"))
+ else if (update.has("category_id") && update.has("parent_id"))
{
parseCategory(update, mFetchDepth);
}