예제 #1
0
        public void WriteHead(IErrorWriter w)
        {
            w.WriteUnencoded(@"
.exception .exceptionType:after { content: ': '; }
.exception .exceptionType { font-size: 1.2em; font-weight: bold; }
.exception .exceptionMessage { font-style: italic; }
.exceptionStackTrace {  }
.exceptionStackTrace .frame { padding: 2px; margin: 0 0 0 30px; border-bottom: 1px #ddd solid; }
.exceptionStackTrace .frame:hover { background-color: #f0f0f0; }
");
        }
예제 #2
0
        protected virtual void WriteException(IErrorWriter w, Exception exc)
        {
            if (exc.InnerException != null)
            {
                WriteException(w, exc.InnerException);
            }

            var source = ExtractSource(exc);

            w.WriteUnencoded("<div class='exception'><span class='exceptionType'>");
            w.WriteText(exc.GetType().FullName);
            w.WriteUnencoded("</span><span class='exceptionMessage'>");
            w.WriteText(exc.Message);
            w.WriteUnencoded("</span>");
            if (source != null)
            {
                w.WriteSourceCode(source, false);
            }
            w.WriteUnencoded("</div><hr />");
        }
예제 #3
0
 protected virtual void WriteException(IErrorWriter w, ExceptionModel model)
 {
     if (model.InnerException != null)
     {
         WriteException(w, model.InnerException);
     }
     w.WriteUnencoded("<div class='exception'><span class='exceptionType'>");
     w.WriteText(model.TypeName);
     w.WriteUnencoded("</span><span class='exceptionMessage'>");
     w.WriteText(model.Message);
     w.WriteUnencoded("</span><hr />");
     if (model.AdditionalInfo != null && model.AdditionalInfo.Length > 0)
     {
         w.WriteUnencoded("<div class='exceptionAdditionalInfo'>");
         foreach (var info in model.AdditionalInfo)
         {
             w.WriteUnencoded("<div> <h3>");
             w.WriteText(info.Title);
             w.WriteUnencoded("</h3>");
             if (info.Objects != null)
             {
                 foreach (var obj in info.Objects)
                 {
                     if (info.Display == ExceptionAdditionalInfo.DisplayMode.ToString)
                     {
                         w.WriteUnencoded("<p>" + WebUtility.HtmlEncode(obj.ToString()) + "</p>");
                     }
                     else if (info.Display == ExceptionAdditionalInfo.DisplayMode.ObjectBrowser)
                     {
                         w.ObjectBrowser(obj);
                     }
                 }
             }
             w.WriteUnencoded("</div><hr />");
         }
         w.WriteUnencoded("</div>");
     }
     w.ObjectBrowser(model.OriginalException);
     w.WriteUnencoded("<hr /><div class='exceptionStackTrace'>");
     foreach (var frame in model.Stack)
     {
         w.WriteUnencoded("<div class='frame'><span class='method code'>");
         w.WriteText(FormatMethod(frame.Method));
         w.WriteUnencoded(" </span>");
         if (frame.At.FileName != null)
         {
             w.WriteText(frame.At.FileName + " +" + frame.At.LineNumber);
         }
         w.WriteUnencoded("<span class='docLinks'>");
         foreach (var icon in frame.MoreInfo)
         {
             w.WriteUnencoded("<a target=\"_blank\" href='" + icon.Link + "'>");
             w.WriteUnencoded(icon.ContentHtml);
             w.WriteUnencoded("</a>");
         }
         w.WriteUnencoded("</span>");
         w.WriteSourceCode(frame.At);
         w.WriteUnencoded("</div>");
     }
     w.WriteUnencoded("</div>");
     w.WriteUnencoded("</div>");
 }