Beispiel #1
0
        internal static void FormatException(ExceptionInfo exceptionInfo, StringBuilder builder)
        {
            if (exceptionInfo == null)
            {
                return;
            }

            if (builder.Length > 0)
            {
                builder.AppendLine("--------------------------------");
            }

            builder.AppendFormat("{0}: {1}", FormatValue(exceptionInfo.GetType().ToString()), FormatValue(exceptionInfo.Message));
            builder.AppendLine();

            //if (!String.IsNullOrEmpty(exceptionInfo.Source))
            //{
            //    builder.AppendFormat(" Source: {0}", FormatValue(exceptionInfo.Source));
            //    builder.AppendLine();
            //}

            if (!String.IsNullOrEmpty(exceptionInfo.StackTrace))
            {
                builder.AppendFormat(" Stack: {0}", FormatValue(exceptionInfo.StackTrace));
                builder.AppendLine();
            }

            if (exceptionInfo.InnerException != null)
            {
                FormatException(exceptionInfo.InnerException, builder);
            }
        }
        internal static void FormatException(ExceptionInfo exceptionInfo, StringBuilder builder)
        {
            if (exceptionInfo == null)
            {
                return;
            }

            if (builder.Length > 0)
            {
                builder.AppendLine("--------------------------------");
            }

            builder.AppendFormat("{0}: {1}", FormatValue(exceptionInfo.GetType().ToString()), FormatValue(exceptionInfo.Message));
            builder.AppendLine();

            //if (!String.IsNullOrEmpty(exceptionInfo.Source))
            //{
            //    builder.AppendFormat(" Source: {0}", FormatValue(exceptionInfo.Source));
            //    builder.AppendLine();
            //}

            if (!String.IsNullOrEmpty(exceptionInfo.StackTrace))
            {
                builder.AppendFormat(" Stack: {0}", FormatValue(exceptionInfo.StackTrace));
                builder.AppendLine();
            }

            if (exceptionInfo.InnerException != null)
            {
                FormatException(exceptionInfo.InnerException, builder);
            }
        }