Wrap() public static method

public static Wrap ( Exception ex, XmlNode node ) : Exception
ex System.Exception
node System.Xml.XmlNode
return System.Exception
示例#1
0
 private Exception WrapException(Exception ex, XmlNodeContext context)
 {
     return(XmlNodeException.Wrap(ex, context.Node));
 }
示例#2
0
 private Exception WrapException(Exception ex, XmlNode node)
 {
     return(XmlNodeException.Wrap(ex, node));
 }
示例#3
0
        internal void Execute(XmlElementContext context, string argumentString)
        {
            if (this.context != null || this.argumentString != null)
            {
                return;
            }
            bool flag1 = false;
            bool flag2 = false;

            try
            {
                this.context        = context;
                this.argumentString = argumentString;
                this.arguments      = (IList <string>)null;
                if (!this.ShouldExecuteTransform())
                {
                    return;
                }
                flag2 = true;
                this.Log.StartSection(MessageType.Verbose, "Executing {0}", new object[1] {
                    (object)this.TransformNameLong
                });
                this.Log.LogMessage(MessageType.Verbose, "on {0}", new object[1] {
                    (object)context.XPath
                });
                if (this.ApplyTransformToAllTargetNodes)
                {
                    this.ApplyOnAllTargetNodes();
                }
                else
                {
                    this.ApplyOnce();
                }
            }
            catch (Exception ex)
            {
                flag1 = true;
                if (context.TransformAttribute != null)
                {
                    this.Log.LogErrorFromException(XmlNodeException.Wrap(ex, (XmlNode)context.TransformAttribute));
                }
                else
                {
                    this.Log.LogErrorFromException(ex);
                }
            }
            finally
            {
                if (flag2)
                {
                    if (flag1)
                    {
                        this.Log.EndSection(MessageType.Verbose, "Error during {0}", new object[1] {
                            (object)this.TransformNameShort
                        });
                    }
                    else
                    {
                        this.Log.EndSection(MessageType.Verbose, "Done executing {0}", new object[1] {
                            (object)this.TransformNameShort
                        });
                    }
                }
                else
                {
                    this.Log.LogMessage(MessageType.Normal, "Not executing {0}", new object[1] {
                        (object)this.TransformNameLong
                    });
                }
                this.context        = (XmlElementContext)null;
                this.argumentString = (string)null;
                this.arguments      = (IList <string>)null;
                this.ReleaseLogger();
            }
        }
示例#4
0
 private Exception WrapException(Exception ex)
 {
     return(XmlNodeException.Wrap(ex, (XmlNode)this.Element));
 }