From 14dc0cfcab678fafd5774d33884a40d5a5972421 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 29 Nov 2011 18:33:32 -0800 Subject: 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. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/HttpServer.cc | 10 +++++++--- 1 file 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 trace); void send400() { std::vector d2; sendError(400, "The HTTP request you've sent is invalid", true, d2); } void send404() { std::vector 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 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 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( " \n" " \n" " {{title}}\n" +" \n" " \n" "\n" " \n" -"

{{msg}}

\n" +"

{{title}}

\n" +"

{{msg}}

\n" "{{#hasTrace}}\n" -"

Context:

\n" +"

Context:

\n" " {{#trace}}
{{line}}
{{/trace}}
\n" "{{/hasTrace}}\n" " \n" -- cgit v1.2.3