diff options
Diffstat (limited to 'OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs')
-rw-r--r-- | OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs | 19 |
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 |