Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7587/Xml
Modified Files:
XmlObjectDefinitionReader.cs
Log Message:
(Partial Fix) SPRNET-867 - Add line number to top level error message when there are XML parsing errors.
Index: XmlObjectDefinitionReader.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml/XmlObjectDefinitionReader.cs,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** XmlObjectDefinitionReader.cs 27 Aug 2007 13:57:43 -0000 1.32
--- XmlObjectDefinitionReader.cs 4 Feb 2008 22:44:03 -0000 1.33
***************
*** 25,29 ****
using System.Xml;
using System.Xml.Schema;
- using Spring.Core;
using Spring.Core.IO;
using Spring.Objects.Factory.Support;
--- 25,28 ----
***************
*** 239,249 ****
catch (XmlException ex)
{
! throw new ObjectDefinitionStoreException(
! "XmlException parsing XML document from " + resource.Description, ex);
}
catch (Exception ex)
{
! throw new ObjectDefinitionStoreException(
! "Unexpected exception parsing XML document from " + resource.Description, ex);
}
}
--- 238,248 ----
catch (XmlException ex)
{
! throw new XmlObjectDefinitionStoreException(resource.Description,
! "Line " + ex.LineNumber + " in XML document from " +
! resource + " is invalid. " + ex.Message, ex);
}
catch (Exception ex)
{
! throw new ObjectDefinitionStoreException("Unexpected exception parsing XML document from " + resource.Description + "Inner exception message= " + ex.Message, ex);
}
}
***************
*** 258,262 ****
if (args.Severity == XmlSeverityType.Error)
{
! throw new XmlException(args.Message, args.Exception);
}
else
--- 257,265 ----
if (args.Severity == XmlSeverityType.Error)
{
! #if !NET_1_0
! throw new XmlException(args.Message, args.Exception, args.Exception.LineNumber, args.Exception.LinePosition);
! #else
! throw new XmlException(args.Message, args.Exception);
! #endif
}
else
|