From 1f402fdf5e8ef53a07f98c4447946805791d26bc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Feb 2012 21:40:28 +0000 Subject: Add url to logging if SynchronousRestFormsRequester.MakRequest() throws an exception in service connectors --- .../Connectors/Friends/FriendsServiceConnector.cs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs') 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 protected FriendInfo[] GetFriends(Dictionary sendData, string PrincipalID) { string reqString = ServerUtils.BuildQueryString(sendData); + string uri = m_ServerURI + "/friends"; try { - string reply = SynchronousRestFormsRequester.MakeRequest("POST", - m_ServerURI + "/friends", - reqString); + string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); if (reply != string.Empty) { Dictionary replyData = ServerUtils.ParseXmlResponse(reply); @@ -143,7 +142,6 @@ namespace OpenSim.Services.Connectors.Friends // Success return finfos.ToArray(); } - else m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: GetFriends {0} received null response", PrincipalID); @@ -152,7 +150,7 @@ namespace OpenSim.Services.Connectors.Friends } catch (Exception e) { - m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); + m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message); } return new FriendInfo[0]; @@ -167,15 +165,14 @@ namespace OpenSim.Services.Connectors.Friends sendData["METHOD"] = "storefriend"; string reply = string.Empty; + string uri = m_ServerURI + "/friends"; try { - reply = SynchronousRestFormsRequester.MakeRequest("POST", - m_ServerURI + "/friends", - ServerUtils.BuildQueryString(sendData)); + reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); } catch (Exception e) { - m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); + m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message); return false; } @@ -223,15 +220,14 @@ namespace OpenSim.Services.Connectors.Friends public bool Delete(Dictionary sendData, string PrincipalID, string Friend) { string reply = string.Empty; + string uri = m_ServerURI = "/friends"; try { - reply = SynchronousRestFormsRequester.MakeRequest("POST", - m_ServerURI + "/friends", - ServerUtils.BuildQueryString(sendData)); + reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); } catch (Exception e) { - m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); + m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message); return false; } -- cgit v1.1