HTTP: Return a 408 on query timeout

This commit is contained in:
Raúl Marín 2022-05-04 14:24:34 +02:00
parent d899ef2e48
commit 6919b459ee

View File

@ -103,6 +103,8 @@ namespace ErrorCodes
extern const int INVALID_SESSION_TIMEOUT;
extern const int HTTP_LENGTH_REQUIRED;
extern const int SUPPORT_IS_DISABLED;
extern const int TIMEOUT_EXCEEDED;
}
namespace
@ -228,6 +230,10 @@ static Poco::Net::HTTPResponse::HTTPStatus exceptionCodeToHTTPStatus(int excepti
{
return HTTPResponse::HTTP_LENGTH_REQUIRED;
}
else if (exception_code == ErrorCodes::TIMEOUT_EXCEEDED)
{
return HTTPResponse::HTTP_REQUEST_TIMEOUT;
}
return HTTPResponse::HTTP_INTERNAL_SERVER_ERROR;
}