Exemplo n.º 1
0
 /// <summary>
 /// Adds an exception to a string error.
 /// </summary>
 /// <param name="sb">The error buffer to which to add.</param>
 /// <param name="err">The exception to add to the error description.</param>
 private void FormatException(StringBuilder sb, XmlException err)
 {
     sb.AppendLine("$exception [" + err.GetType().Name + "]: " + err.Message);
     if (err.LineNumber > 0 && err.LineNumber <= textBoxXML.Lines.Length)
     {
         // If we have a valid error position, then display the problematic
         //  XML line with a pointer to where the error was detected.
         // Note: This code assumes a monospaced font is used to display the error.
         sb.AppendLine(textBoxXML.Lines[err.LineNumber - 1]);
         sb.AppendLine("^".PadLeft(err.LinePosition, ' '));
     }
     sb.AppendLine(err.StackTrace);
 }
Exemplo n.º 2
0
 private void CompareException(XmlException e, string ec, Exception inner, int ln, int lp)
 {
     CError.WriteLine(e);
     CError.Compare((object)e.InnerException, (object)inner, "InnerException");
     CError.Compare(e.LineNumber, ln, "LineNumber");
     CError.Compare(e.LinePosition, lp, "LinePosition");
     string s1 = e.StackTrace;
     Type t = e.GetType();
     Exception e2 = e.GetBaseException();
     int i = e.GetHashCode();
     CError.Compare(!String.IsNullOrEmpty(e.Message), "Message");
     string s3 = e.ToString();
 }
Exemplo n.º 3
0
        private void CompareException(XmlException e, string ec, Exception inner, int ln, int lp)
        {
            CError.WriteLine(e);
            CError.Compare((object)e.InnerException, (object)inner, "InnerException");
            CError.Compare(e.LineNumber, ln, "LineNumber");
            CError.Compare(e.LinePosition, lp, "LinePosition");
            string    s1 = e.StackTrace;
            Type      t  = e.GetType();
            Exception e2 = e.GetBaseException();
            int       i  = e.GetHashCode();

            CError.Compare(!String.IsNullOrEmpty(e.Message), "Message");
            string s3 = e.ToString();
        }
Exemplo n.º 4
0
        // public static TheDarkOwlLogger.TheDarkOwlLogger Bugger = new TheDarkOwlLogger.TheDarkOwlLogger(false, true, true, "WhiteTiger");
        public static void errorreport(Exception e)
        {
            NoNullAllowedException nonullallowedext = new NoNullAllowedException();

            System.Data.RowNotInTableException exrownotinTable = new RowNotInTableException();
            System.ArgumentOutOfRangeException excarg          = new ArgumentOutOfRangeException();
            System.IO.FileNotFoundException    filenotfound    = new FileNotFoundException();
            System.Xml.XmlException            xmlexc          = new XmlException();
            if ((e.GetType() != nonullallowedext.GetType()) && (e.GetType() != exrownotinTable.GetType()) &&
                (e.GetType() != excarg.GetType()) && (e.GetType() != filenotfound.GetType()) &&
                (e.GetType() != xmlexc.GetType()))
            {
                logman.TraceException(e.Message, e);
            }
        }