예제 #1
0
 private void write500(IDictionary <string, object> environment, Exception exception)
 {
     using (var writer = new OwinHttpResponse(environment))
     {
         writer.WriteResponseCode(HttpStatusCode.InternalServerError);
         writer.Write("FubuMVC has detected an exception\r\n");
         writer.Write(exception.ToString());
     }
 }
예제 #2
0
        private void write500(IDictionary <string, object> environment, Exception exception)
        {
            using (var writer = new OwinHttpResponse(environment))
            {
                writer.WriteResponseCode(HttpStatusCode.InternalServerError);
                var document = new HtmlDocument
                {
                    Title = "Exception!"
                };

                document.Add("h1").Text("FubuMVC has detected an exception");
                document.Add("hr");
                document.Add("pre").Id("error").Text(exception.ToString());

                writer.WriteContentType(MimeType.Html.Value);
                writer.Write(document.ToString());
            }
        }