public Task HandleException(IWebHandler handler, WebBasePage page, Exception ex) { FileData data = FileData.Create(fFileName); if (LogException) { string type = page == null?handler.GetType().ToString() : page.GetType().ToString(); ExceptionData exData = new ExceptionData(handler.SourceInfo.Source, type, handler.PageUrl.ToString(), ex); ExceptionUtil.LogException(exData); } handler.Response.ContentType = ContentTypeConst.HTML; return(handler.Response.WriteAsync(Encoding.UTF8.GetString(data.Data), Encoding.UTF8)); }
public Task HandleException(IWebHandler handler, WebBasePage page, Exception ex) { string type = page == null?handler.GetType().ToString() : page.GetType().ToString(); ExceptionSource source = new ExceptionSource(handler.SourceInfo.Source, type, handler.PageUrl.ToString(), ex); if (LogException || handler.IsPost) { string fileName = ExceptionUtil.LogException(source.Data); source.FileName = fileName; } return(InternalWebUtil.WritePage(null, source, fPageMaker, handler)); }