#include <exception>
+#include <typeinfo>
#include <msp/core/maputils.h>
#include <msp/core/refptr.h>
+#include <msp/debug/demangle.h>
#include <msp/net/inet.h>
#include <msp/net/resolve.h>
#include <msp/net/streamsocket.h>
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();
}
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()));
}
}