diff options
author | Pixel <pixel@nobis-crew.org> | 2011-11-29 18:33:32 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-11-29 18:58:58 -0800 |
commit | 14dc0cfcab678fafd5774d33884a40d5a5972421 (patch) | |
tree | 25cec4419ca44b87b26443b77d139bed94a27b52 | |
parent | 79b55693014230053ffbdb1bd3ad7d13a6e2383a (diff) |
Making things a bit more pretty:
-) Using an actual embedded style sheet within the error document (serifs are evil)
-) Changing the ugly `' into `ยด, at least for the HTML output.
-) Adding the title into the error page.
-rw-r--r-- | src/HttpServer.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 3526a2a..ac479ff 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -45,7 +45,7 @@ class HttpWorker : public Task { void sendError(int error, const char * msg, bool closeConnection, std::vector<String> trace); void send400() { std::vector<String> d2; sendError(400, "The HTTP request you've sent is invalid", true, d2); } void send404() { std::vector<String> d2; sendError(404, "The HTTP request you've sent didn't match any action on this server.", false, d2); } - void send500(const char * msg, std::vector<String> trace) { String smsg; smsg.set("The HTTP request you've sent triggered an internal error: `%s'", msg); sendError(500, smsg.to_charp(), true, trace); } + void send500(const char * msg, std::vector<String> trace) { String smsg; smsg.set("The HTTP request you've sent triggered an internal error: `%s\xc2\xb4", msg); sendError(500, smsg.to_charp(), true, trace); } String httpUnescape(const char * in); void readVariables(Http::StringMap & variables, char * str); @@ -77,12 +77,16 @@ const Balau::String SetDefaultTemplate::m_defaultErrorTemplate( " <head>\n" " <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n" " <title>{{title}}</title>\n" +" <style type=\"text/css\">\n" +" body { font-family: arial, helvetica, sans-serif; }\n" +" </style>\n" " </head>\n" "\n" " <body>\n" -" <h1>{{msg}}</h1>\n" +" <h1>{{title}}</h1>\n" +" <h2>{{msg}}</h2>\n" "{{#hasTrace}}\n" -" <br /><h2>Context:</h2>\n" +" <br /><h3>Context:</h3>\n" " {{#trace}}<pre>{{line}}</pre>{{/trace}}<br />\n" "{{/hasTrace}}\n" " </body>\n" |