X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhttp%2Fserver.cpp;fp=source%2Fhttp%2Fserver.cpp;h=7caa0f5d025b6eb0e55db15f55cbf896aadf40ba;hb=a82a89a937d798b5b376d6a58917557a92c56988;hp=f0474fd18e993c57de16b1a3f51c07dc260f069f;hpb=dadb1b2524c26b12c0dff1d720fe2b080885d378;p=libs%2Fnet.git diff --git a/source/http/server.cpp b/source/http/server.cpp index f0474fd..7caa0f5 100644 --- a/source/http/server.cpp +++ b/source/http/server.cpp @@ -1,6 +1,8 @@ #include +#include #include #include +#include #include #include #include @@ -123,7 +125,8 @@ void Server::client_data_available(Client &cl) catch(const exception &e) { response = new Response(BAD_REQUEST); - response->add_content(e.what()); + response->add_content(format("An error occurred while parsing request headers:\ntype: %s\nwhat: %s", + Debug::demangle(typeid(e).name()), e.what())); } cl.in_buf = string(); } @@ -164,7 +167,8 @@ void Server::client_data_available(Client &cl) responses.erase(cl.response); cl.response = 0; response = new Response(INTERNAL_ERROR); - response->add_content(e.what()); + response->add_content(format("An error occurred while processing the request:\ntype: %s\nwhat: %s", + Debug::demangle(typeid(e).name()), e.what())); } }