From 78e24380c8147e897072023f1dd76c895a42335d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 18 Mar 2008 19:52:07 +0000 Subject: * Stop grid inventory network failures crashing the client session * Now the operation will just fail and post a message to the log instead, which may be mysterious to the client but isn't so brutal --- .../Communications/OGS1/OGS1InventoryService.cs | 59 +++++++++++++++++----- 1 file changed, 46 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs') diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 19ed940..3551172 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.Communications.OGS1 try { m_log.InfoFormat( - "[INVENTORY]: Requesting inventory from {0}/GetInventory/ for user {1}", + "[OGS1 INVENTORY SERVICE]: Requesting inventory from {0}/GetInventory/ for user {1}", _inventoryServerUrl, userID); RestObjectPosterResponse requester @@ -83,9 +83,10 @@ namespace OpenSim.Region.Communications.OGS1 requester.BeginPostObject(_inventoryServerUrl + "/GetInventory/", userID.UUID); } - catch (Exception e) + catch (System.Net.WebException e) { - m_log.Error("[INVENTORY]: " + e.ToString()); + m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Request inventory operation failed, {0} {1}", + e.Source, e.Message); } } @@ -98,7 +99,7 @@ namespace OpenSim.Region.Communications.OGS1 LLUUID userID = response.UserID; if (m_RequestingInventory.ContainsKey(userID)) { - m_log.InfoFormat("[INVENTORY]: " + + m_log.InfoFormat("[OGS1 INVENTORY SERVICE]: " + "Received inventory response for user {0} containing {1} folders and {2} items", userID, response.Folders.Count, response.AllItems.Count); @@ -135,7 +136,7 @@ namespace OpenSim.Region.Communications.OGS1 else { m_log.WarnFormat( - "[INVENTORY]: " + + "[OGS1 INVENTORY SERVICE]: " + "Received inventory response for {0} for which we do not have a record of requesting!", userID); } @@ -143,26 +144,58 @@ namespace OpenSim.Region.Communications.OGS1 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) { - SynchronousRestObjectPoster.BeginPostObject( - "POST", _inventoryServerUrl + "/NewFolder/", folder); + try + { + SynchronousRestObjectPoster.BeginPostObject( + "POST", _inventoryServerUrl + "/NewFolder/", folder); + } + catch (System.Net.WebException e) + { + m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory folder operation failed, {0} {1}", + e.Source, e.Message); + } } public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) { - SynchronousRestObjectPoster.BeginPostObject( - "POST", _inventoryServerUrl + "/MoveFolder/", folder); + try + { + SynchronousRestObjectPoster.BeginPostObject( + "POST", _inventoryServerUrl + "/MoveFolder/", folder); + } + catch (System.Net.WebException e) + { + m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", + e.Source, e.Message); + } } public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) { - SynchronousRestObjectPoster.BeginPostObject( - "POST", _inventoryServerUrl + "/NewItem/", item); + try + { + SynchronousRestObjectPoster.BeginPostObject( + "POST", _inventoryServerUrl + "/NewItem/", item); + } + catch (System.Net.WebException e) + { + m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory item operation failed, {0} {1}", + e.Source, e.Message); + } } public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) { - SynchronousRestObjectPoster.BeginPostObject( - "POST", _inventoryServerUrl + "/DeleteItem/", item); + try + { + SynchronousRestObjectPoster.BeginPostObject( + "POST", _inventoryServerUrl + "/DeleteItem/", item); + } + catch (System.Net.WebException e) + { + m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Delete inventory item operation failed, {0} {1}", + e.Source, e.Message); + } } public bool HasInventoryForUser(LLUUID userID) -- cgit v1.1