/[xmltv_parser]/trunk/libxmltv/Core/XMLTVRuntimeInstance.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/XMLTVRuntimeInstance.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/libxmltv/Core/XMLTVRuntimeInstance.cs	2013/03/09 12:23:27	81
+++ trunk/libxmltv/Core/XMLTVRuntimeInstance.cs	2013/03/09 12:41:07	83
@@ -352,7 +352,14 @@
                     }
                 }
             }
-            if (handler_type == null) { throw new Exception("Unable to find a compatible handler to parse document root."); }
+            if (handler_type == null) 
+            {
+                StringBuilder node_builder = new StringBuilder();
+                node_builder.AppendFormat("<{0} ", root.Name);
+                if (root.HasAttributes) { foreach (var attribute in root.Attributes()) { node_builder.AppendFormat("{0}=\"{1}\" ", attribute.Name, attribute.Value); } }
+                string node_text = string.Format("{0}>", node_builder.ToString().TrimEnd(new char[] { ' ' }));
+                throw new Exception(string.Format("Unable to find a compatible handler to parse node: {0}", node_text)); 
+            }
             xmltv_logger.Verbose.Debug.WriteLine("Created handler for root: '{0}'", root_name.ToString());
             raw_instance = Activator.CreateInstance(handler_type, flags, null, new object[] { gInstance }, culture);
         }
@@ -398,7 +405,14 @@
                     }
                 }
             }
-            if (handler_type == null) { throw new Exception("Unable to find a compatible handler to parse document root."); }
+            if (handler_type == null) 
+            {
+                StringBuilder node_builder = new StringBuilder();
+                node_builder.AppendFormat("<{0} ", node.Name);
+                if (node.HasAttributes) { foreach (var attribute in node.Attributes()) { node_builder.AppendFormat("{0}=\"{1}\" ", attribute.Name, attribute.Value); } }
+                string node_text = string.Format("{0}>", node_builder.ToString().TrimEnd(new char[] { ' ' }));
+                throw new Exception(string.Format("Unable to find a compatible handler to parse node: {0}", node_text)); 
+            }
             xmltv_logger.Verbose.Debug.WriteLine("Created handler for node: '{0}'", node_name.ToString());
             raw_instance = Activator.CreateInstance(handler_type, flags, null, new object[] { gInstance, node }, culture);
             return true;

 

  ViewVC Help
Powered by ViewVC 1.1.22