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());
}
}
}