mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
36 lines
794 B
C++
36 lines
794 B
C++
#include "NotFoundHandler.h"
|
|
|
|
#include <IO/HTTPCommon.h>
|
|
|
|
#include <Common/Exception.h>
|
|
|
|
#include <Poco/Net/HTTPServerRequest.h>
|
|
#include <Poco/Net/HTTPServerResponse.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void NotFoundHandler::handleRequest(
|
|
Poco::Net::HTTPServerRequest & request,
|
|
Poco::Net::HTTPServerResponse & response)
|
|
{
|
|
try
|
|
{
|
|
response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_NOT_FOUND);
|
|
|
|
std::stringstream output_description;
|
|
output_description << "There is no handle " << request.getURI() << "\n\n";
|
|
|
|
if (!no_handler_description.empty())
|
|
output_description << no_handler_description << "\n";
|
|
|
|
response.send() << output_description.str();
|
|
}
|
|
catch (...)
|
|
{
|
|
tryLogCurrentException("NotFoundHandler");
|
|
}
|
|
}
|
|
|
|
}
|