From 2de9a522e6a4a6c3c885bd080917318e45953d62 Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 16 Dec 2010 22:35:05 +0000 Subject: Return HTTP 500 on error Use AJAX to track and untrack packages --- project2/cgi/p2webMain.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/project2/cgi/p2webMain.cpp b/project2/cgi/p2webMain.cpp index 59e8d7b..25a4300 100644 --- a/project2/cgi/p2webMain.cpp +++ b/project2/cgi/p2webMain.cpp @@ -2,6 +2,7 @@ #include #include #include +#include FILE * realstdout = stdout; #include #include "cgiEnvironment.h" @@ -68,7 +69,7 @@ int main(void) app.write(boost::bind(xmlSaveFileTo, out, _1, "utf-8")); } catch (const std::exception & e) { - cgicc::HTTPContentHeader header("text/plain"); + cgicc::HTTPStatusHeader header(500, e.what()); header.render(IO); IO << "Kaboom!" << std::endl << std::endl @@ -76,7 +77,7 @@ int main(void) << e.what() << std::endl; } catch (...) { - cgicc::HTTPContentHeader header("text/plain"); + cgicc::HTTPStatusHeader header(500, "Unknown exception"); header.render(IO); IO << "Kaboom!" << std::endl << std::endl -- cgit v1.2.3