public string GetExceptionText(IApplication threw, Exception e) { var sw = new StringWriter(); sw.WriteException(e); Console.WriteLine("Exception while processing request."); Console.Out.WriteException(e); return sw.ToString(); }
public IResponse GetExceptionResponse(IApplication threw, Exception e) { var sw = new StringWriter(); sw.WriteException(e); Console.WriteLine("Exception while processing request."); Console.Out.WriteException(e); return new KayakResponse("503 Internal Server Error", new Dictionary<string, IEnumerable<string>>() { { "Content-Type", new string[] { "text/html" } } }, "<pre>" + sw.ToString() + "</pre>"); }