summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-12-16 22:35:05 +0000
committerrandomdan <randomdan@localhost>2010-12-16 22:35:05 +0000
commit2de9a522e6a4a6c3c885bd080917318e45953d62 (patch)
treebdb08065ee62d98582c37e57e71a2111b4bda724
parentAdd support for non-default Sql merge inserter (diff)
downloadproject2-2de9a522e6a4a6c3c885bd080917318e45953d62.tar.bz2
project2-2de9a522e6a4a6c3c885bd080917318e45953d62.tar.xz
project2-2de9a522e6a4a6c3c885bd080917318e45953d62.zip
Return HTTP 500 on error
Use AJAX to track and untrack packages
-rw-r--r--project2/cgi/p2webMain.cpp5
1 files 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 <cgicc/Cgicc.h>
#include <cgicc/CgiEnvironment.h>
#include <cgicc/HTTPContentHeader.h>
+#include <cgicc/HTTPStatusHeader.h>
FILE * realstdout = stdout;
#include <fcgi_stdio.h>
#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