aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Addons/OfflineIM
diff options
context:
space:
mode:
authorOren Hurvitz2014-04-21 09:01:42 +0300
committerOren Hurvitz2014-04-21 16:56:26 +0100
commit538ff31b284298083bdb0c6c998e4bae9a369f98 (patch)
treefdace8a4b679d1325e0b9105c3c83f50d7d25dfa /OpenSim/Addons/OfflineIM
parentRemoved an attempt to set a user's presence to "Region 0" when they HG telepo... (diff)
downloadopensim-SC-538ff31b284298083bdb0c6c998e4bae9a369f98.zip
opensim-SC-538ff31b284298083bdb0c6c998e4bae9a369f98.tar.gz
opensim-SC-538ff31b284298083bdb0c6c998e4bae9a369f98.tar.bz2
opensim-SC-538ff31b284298083bdb0c6c998e4bae9a369f98.tar.xz
Better error handling when retrieving offline IMs
Diffstat (limited to 'OpenSim/Addons/OfflineIM')
-rw-r--r--OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs
index f6b17e5..eb287a4 100644
--- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs
+++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs
@@ -82,8 +82,13 @@ namespace OpenSim.OfflineIM
82 if (!ret.ContainsKey("RESULT")) 82 if (!ret.ContainsKey("RESULT"))
83 return ims; 83 return ims;
84 84
85 if (ret["RESULT"].ToString() == "NULL") 85 string result = ret["RESULT"].ToString();
86 if (result == "NULL" || result.ToLower() == "false")
87 {
88 string reason = ret.ContainsKey("REASON") ? ret["REASON"].ToString() : "Unknown error";
89 m_log.DebugFormat("[OfflineIM.V2.RemoteConnector]: GetMessages for {0} failed: {1}", principalID, reason);
86 return ims; 90 return ims;
91 }
87 92
88 foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values) 93 foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values)
89 { 94 {
@@ -110,7 +115,7 @@ namespace OpenSim.OfflineIM
110 string result = ret["RESULT"].ToString(); 115 string result = ret["RESULT"].ToString();
111 if (result == "NULL" || result.ToLower() == "false") 116 if (result == "NULL" || result.ToLower() == "false")
112 { 117 {
113 reason = ret["REASON"].ToString(); 118 reason = ret.ContainsKey("REASON") ? ret["REASON"].ToString() : "Unknown error";
114 return false; 119 return false;
115 } 120 }
116 121