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)
{
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;
}
if (!response.ContainsKey("_Result"))
{
m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}",
method, OSDParser.SerializeJsonString(response));
m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
method, uri, OSDParser.SerializeJsonString(response));
return false;
}
response = (OSDMap)response["_Result"];
@ -107,15 +107,15 @@ namespace OpenSim.Framework.Servers.HttpServer
if (response.ContainsKey("error"))
{
data = response["error"];
m_log.DebugFormat("JsonRpc request '{0}' returned an error: {1}",
method, OSDParser.SerializeJsonString(data));
m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an error: {2}",
method, uri, OSDParser.SerializeJsonString(data));
return false;
}
if (!response.ContainsKey("result"))
{
m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}",
method, OSDParser.SerializeJsonString(response));
m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
method, uri, OSDParser.SerializeJsonString(response));
return false;
}
@ -161,14 +161,14 @@ namespace OpenSim.Framework.Servers.HttpServer
}
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;
}
if (!response.ContainsKey("_Result"))
{
m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}",
method, OSDParser.SerializeJsonString(response));
m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
method, uri, OSDParser.SerializeJsonString(response));
return false;
}
response = (OSDMap)response["_Result"];
@ -176,8 +176,8 @@ namespace OpenSim.Framework.Servers.HttpServer
if (response.ContainsKey("error"))
{
data = response["error"];
m_log.DebugFormat("JsonRpc request '{0}' returned an error: {1}",
method, OSDParser.SerializeJsonString(data));
m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an error: {2}",
method, uri, OSDParser.SerializeJsonString(data));
return false;
}

View File

@ -484,6 +484,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error updating classified", false);
return;
}
}
@ -510,6 +511,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error classified delete", false);
return;
}
parameters = (OSDMap)Params;
@ -612,6 +614,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error selecting pick", false);
return;
}
pick = (UserProfilePick) Pick;
@ -714,6 +717,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error updating pick", false);
return;
}
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(
"Error picks delete", false);
return;
}
}
#endregion Picks
@ -807,6 +812,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
object Note = note;
if(!rpc.JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString()))
{
remoteClient.SendAgentAlertMessage(
"Error updating note", false);
return;
}
}
@ -916,6 +923,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error updating interests", false);
return;
}
}
@ -1044,6 +1052,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error updating properties", false);
return;
}
RequestAvatarProperties(remoteClient, newProfile.ID);