aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Serialization
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-13 20:43:26 +0000
committerJustin Clark-Casey (justincc)2012-02-13 20:43:26 +0000
commit189c67db957cadfe1bb5bd8aad0c86dec1ff295b (patch)
tree5bc7edae8044dac005ce841d99a6aad3154a87c3 /OpenSim/Framework/Serialization
parentFix: Unable to remove AV from friend list (sqldb-bug) http://opensimulator.or... (diff)
downloadopensim-SC_OLD-189c67db957cadfe1bb5bd8aad0c86dec1ff295b.zip
opensim-SC_OLD-189c67db957cadfe1bb5bd8aad0c86dec1ff295b.tar.gz
opensim-SC_OLD-189c67db957cadfe1bb5bd8aad0c86dec1ff295b.tar.bz2
opensim-SC_OLD-189c67db957cadfe1bb5bd8aad0c86dec1ff295b.tar.xz
On object deserialization, go back to logging errors at DEBUG level rather than ERROR. Restore extra log message if shape processing fails.
Logging level was DEBUG before 312e145 (Fri Feb 3 2012). 312e145 also accidentally removed the 'general error' log message if any shape deserialization failed. This commit restores it, though this has no functional impact.
Diffstat (limited to 'OpenSim/Framework/Serialization')
-rw-r--r--OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs19
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
index a392af6..c56f213 100644
--- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
+++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
@@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External
49 /// <param name="nodeToFill"></param> 49 /// <param name="nodeToFill"></param>
50 /// <param name="processors">/param> 50 /// <param name="processors">/param>
51 /// <param name="xtr"></param> 51 /// <param name="xtr"></param>
52 public static void ExecuteReadProcessors<NodeType>( 52 /// <returns>true on successful, false if there were any processing failures</returns>
53 public static bool ExecuteReadProcessors<NodeType>(
53 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) 54 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
54 { 55 {
55 ExecuteReadProcessors( 56 return ExecuteReadProcessors(
56 nodeToFill, 57 nodeToFill,
57 processors, 58 processors,
58 xtr, 59 xtr,
59 (o, name, e) 60 (o, name, e)
60 => m_log.ErrorFormat( 61 => m_log.DebugFormat(
61 "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", 62 "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
62 name, e.Message, e.StackTrace)); 63 name, e.Message, e.StackTrace));
63 } 64 }
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
71 /// <param name="parseExceptionAction"> 72 /// <param name="parseExceptionAction">
72 /// Action to take if there is a parsing problem. This will usually just be to log the exception 73 /// Action to take if there is a parsing problem. This will usually just be to log the exception
73 /// </param> 74 /// </param>
74 public static void ExecuteReadProcessors<NodeType>( 75 /// <returns>true on successful, false if there were any processing failures</returns>
76 public static bool ExecuteReadProcessors<NodeType>(
75 NodeType nodeToFill, 77 NodeType nodeToFill,
76 Dictionary<string, Action<NodeType, XmlTextReader>> processors, 78 Dictionary<string, Action<NodeType, XmlTextReader>> processors,
77 XmlTextReader xtr, 79 XmlTextReader xtr,
78 Action<NodeType, string, Exception> parseExceptionAction) 80 Action<NodeType, string, Exception> parseExceptionAction)
79 { 81 {
82 bool errors = false;
83
80 string nodeName = string.Empty; 84 string nodeName = string.Empty;
81 while (xtr.NodeType != XmlNodeType.EndElement) 85 while (xtr.NodeType != XmlNodeType.EndElement)
82 { 86 {
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
95 } 99 }
96 catch (Exception e) 100 catch (Exception e)
97 { 101 {
102 errors = true;
98 parseExceptionAction(nodeToFill, nodeName, e); 103 parseExceptionAction(nodeToFill, nodeName, e);
99 104
100 if (xtr.NodeType == XmlNodeType.EndElement) 105 if (xtr.NodeType == XmlNodeType.EndElement)
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
107 xtr.ReadOuterXml(); // ignore 112 xtr.ReadOuterXml(); // ignore
108 } 113 }
109 } 114 }
115
116 return errors;
110 } 117 }
111 118
112 /// <summary> 119 /// <summary>
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
140 UUID.TryParse(node.InnerText, out uuid); 147 UUID.TryParse(node.InnerText, out uuid);
141 creator = userService.GetUserAccount(scopeID, uuid); 148 creator = userService.GetUserAccount(scopeID, uuid);
142 } 149 }
150
143 if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty) 151 if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
144 hasCreatorData = true; 152 hasCreatorData = true;
145 153
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
163 doc.Save(wr); 171 doc.Save(wr);
164 return wr.ToString(); 172 return wr.ToString();
165 } 173 }
166
167 } 174 }
168 } 175 }
169} 176} \ No newline at end of file