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