Konstantin Koch cb01231e7d implemented Intermediate.Serializer namespace in Content Pipeline.
removed the old .tfignore file.
2015-03-29 18:16:03 +02:00

31 lines
1.0 KiB
C#

using ANX.Framework.NonXNA.Development;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace ANX.Framework.Content.Pipeline.Helpers
{
internal static class ExceptionHelper
{
[Developer("KorsarNek")]
public static Exception CreateInvalidContentException(XmlReader xml, string basePath, Exception innerException, string message)
{
ContentIdentity contentIdentity = new ContentIdentity();
if (basePath != null)
contentIdentity.SourceFilename = basePath;
else
contentIdentity.SourceFilename = xml.BaseURI;
IXmlLineInfo xmlLineInfo = xml as IXmlLineInfo;
if (xmlLineInfo != null)
{
contentIdentity.FragmentIdentifier = string.Format("{0},{1}", xmlLineInfo.LineNumber,xmlLineInfo.LinePosition);
}
return new InvalidContentException(message, contentIdentity, innerException);
}
}
}