Better error-handling and logging in case User Profile requests fail

bullet-2.82
Oren Hurvitz 2014-05-16 13:18:04 +03:00
parent 96e5836b50
commit 882af7195c
2 changed files with 21 additions and 12 deletions

View File

@ -90,14 +90,14 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Debug(string.Format("JsonRpc request '{0}' failed", method), e); m_log.Debug(string.Format("JsonRpc request '{0}' to {1} failed", method, uri), e);
return false; return false;
} }
if (!response.ContainsKey("_Result")) if (!response.ContainsKey("_Result"))
{ {
m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}", m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
method, OSDParser.SerializeJsonString(response)); method, uri, OSDParser.SerializeJsonString(response));
return false; return false;
} }
response = (OSDMap)response["_Result"]; response = (OSDMap)response["_Result"];
@ -107,15 +107,15 @@ namespace OpenSim.Framework.Servers.HttpServer
if (response.ContainsKey("error")) if (response.ContainsKey("error"))
{ {
data = response["error"]; data = response["error"];
m_log.DebugFormat("JsonRpc request '{0}' returned an error: {1}", m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an error: {2}",
method, OSDParser.SerializeJsonString(data)); method, uri, OSDParser.SerializeJsonString(data));
return false; return false;
} }
if (!response.ContainsKey("result")) if (!response.ContainsKey("result"))
{ {
m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}", m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
method, OSDParser.SerializeJsonString(response)); method, uri, OSDParser.SerializeJsonString(response));
return false; return false;
} }
@ -161,14 +161,14 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Debug(string.Format("JsonRpc request '{0}' failed", method), e); m_log.Debug(string.Format("JsonRpc request '{0}' to {1} failed", method, uri), e);
return false; return false;
} }
if (!response.ContainsKey("_Result")) if (!response.ContainsKey("_Result"))
{ {
m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}", m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
method, OSDParser.SerializeJsonString(response)); method, uri, OSDParser.SerializeJsonString(response));
return false; return false;
} }
response = (OSDMap)response["_Result"]; response = (OSDMap)response["_Result"];
@ -176,8 +176,8 @@ namespace OpenSim.Framework.Servers.HttpServer
if (response.ContainsKey("error")) if (response.ContainsKey("error"))
{ {
data = response["error"]; data = response["error"];
m_log.DebugFormat("JsonRpc request '{0}' returned an error: {1}", m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an error: {2}",
method, OSDParser.SerializeJsonString(data)); method, uri, OSDParser.SerializeJsonString(data));
return false; return false;
} }

View File

@ -484,6 +484,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
remoteClient.SendAgentAlertMessage( remoteClient.SendAgentAlertMessage(
"Error updating classified", false); "Error updating classified", false);
return;
} }
} }
@ -510,6 +511,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
remoteClient.SendAgentAlertMessage( remoteClient.SendAgentAlertMessage(
"Error classified delete", false); "Error classified delete", false);
return;
} }
parameters = (OSDMap)Params; parameters = (OSDMap)Params;
@ -612,6 +614,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
remoteClient.SendAgentAlertMessage( remoteClient.SendAgentAlertMessage(
"Error selecting pick", false); "Error selecting pick", false);
return;
} }
pick = (UserProfilePick) Pick; pick = (UserProfilePick) Pick;
@ -714,6 +717,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
remoteClient.SendAgentAlertMessage( remoteClient.SendAgentAlertMessage(
"Error updating pick", false); "Error updating pick", false);
return;
} }
m_log.DebugFormat("[PROFILES]: Finish PickInfoUpdate {0} {1}", pick.Name, pick.PickId.ToString()); m_log.DebugFormat("[PROFILES]: Finish PickInfoUpdate {0} {1}", pick.Name, pick.PickId.ToString());
@ -740,6 +744,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
remoteClient.SendAgentAlertMessage( remoteClient.SendAgentAlertMessage(
"Error picks delete", false); "Error picks delete", false);
return;
} }
} }
#endregion Picks #endregion Picks
@ -807,6 +812,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
object Note = note; object Note = note;
if(!rpc.JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) if(!rpc.JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString()))
{ {
remoteClient.SendAgentAlertMessage(
"Error updating note", false);
return; return;
} }
} }
@ -916,6 +923,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
remoteClient.SendAgentAlertMessage( remoteClient.SendAgentAlertMessage(
"Error updating interests", false); "Error updating interests", false);
return;
} }
} }
@ -1044,6 +1052,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
remoteClient.SendAgentAlertMessage( remoteClient.SendAgentAlertMessage(
"Error updating properties", false); "Error updating properties", false);
return;
} }
RequestAvatarProperties(remoteClient, newProfile.ID); RequestAvatarProperties(remoteClient, newProfile.ID);