aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-07 21:40:28 +0000
committerJustin Clark-Casey (justincc)2012-02-07 21:40:28 +0000
commit1f402fdf5e8ef53a07f98c4447946805791d26bc (patch)
treed7a0ea0ee0538e0a14bb69dd2e76cf9ac43e34b5 /OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
parentAdd TestAddTaskInventoryItem() (diff)
downloadopensim-SC-1f402fdf5e8ef53a07f98c4447946805791d26bc.zip
opensim-SC-1f402fdf5e8ef53a07f98c4447946805791d26bc.tar.gz
opensim-SC-1f402fdf5e8ef53a07f98c4447946805791d26bc.tar.bz2
opensim-SC-1f402fdf5e8ef53a07f98c4447946805791d26bc.tar.xz
Add url to logging if SynchronousRestFormsRequester.MakRequest() throws an exception in service connectors
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs22
1 files changed, 9 insertions, 13 deletions
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
index 41361ab..44138c9 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
@@ -108,12 +108,11 @@ namespace OpenSim.Services.Connectors.Friends
108 protected FriendInfo[] GetFriends(Dictionary<string, object> sendData, string PrincipalID) 108 protected FriendInfo[] GetFriends(Dictionary<string, object> sendData, string PrincipalID)
109 { 109 {
110 string reqString = ServerUtils.BuildQueryString(sendData); 110 string reqString = ServerUtils.BuildQueryString(sendData);
111 string uri = m_ServerURI + "/friends";
111 112
112 try 113 try
113 { 114 {
114 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 115 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
115 m_ServerURI + "/friends",
116 reqString);
117 if (reply != string.Empty) 116 if (reply != string.Empty)
118 { 117 {
119 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 118 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -143,7 +142,6 @@ namespace OpenSim.Services.Connectors.Friends
143 // Success 142 // Success
144 return finfos.ToArray(); 143 return finfos.ToArray();
145 } 144 }
146
147 else 145 else
148 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: GetFriends {0} received null response", 146 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: GetFriends {0} received null response",
149 PrincipalID); 147 PrincipalID);
@@ -152,7 +150,7 @@ namespace OpenSim.Services.Connectors.Friends
152 } 150 }
153 catch (Exception e) 151 catch (Exception e)
154 { 152 {
155 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 153 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
156 } 154 }
157 155
158 return new FriendInfo[0]; 156 return new FriendInfo[0];
@@ -167,15 +165,14 @@ namespace OpenSim.Services.Connectors.Friends
167 sendData["METHOD"] = "storefriend"; 165 sendData["METHOD"] = "storefriend";
168 166
169 string reply = string.Empty; 167 string reply = string.Empty;
168 string uri = m_ServerURI + "/friends";
170 try 169 try
171 { 170 {
172 reply = SynchronousRestFormsRequester.MakeRequest("POST", 171 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
173 m_ServerURI + "/friends",
174 ServerUtils.BuildQueryString(sendData));
175 } 172 }
176 catch (Exception e) 173 catch (Exception e)
177 { 174 {
178 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 175 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
179 return false; 176 return false;
180 } 177 }
181 178
@@ -223,15 +220,14 @@ namespace OpenSim.Services.Connectors.Friends
223 public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend) 220 public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend)
224 { 221 {
225 string reply = string.Empty; 222 string reply = string.Empty;
223 string uri = m_ServerURI = "/friends";
226 try 224 try
227 { 225 {
228 reply = SynchronousRestFormsRequester.MakeRequest("POST", 226 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
229 m_ServerURI + "/friends",
230 ServerUtils.BuildQueryString(sendData));
231 } 227 }
232 catch (Exception e) 228 catch (Exception e)
233 { 229 {
234 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 230 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
235 return false; 231 return false;
236 } 232 }
237 233