#include <userver/server/http/http_error.hpp>
An extension of server::handlers::CustomHandlerException that allows to specify a custom HttpStatus.
For non-HTTP protocols, the status code will be derived from the attached server::handlers::HandlerErrorCode.
Definition at line 36 of file http_error.hpp.
◆ ExternalBody
◆ ExtraHeaders
◆ HandlerErrorCode
◆ InternalMessage
◆ ServiceErrorCode
◆ CustomHandlerException()
template<typename... Args>
- See also
- server::handlers::CustomHandlerException for the description of how
args
that can augment error messages. TEST(CustomHandlerException, DirectHttpSample) {
server::http::HttpStatus::kUnprocessableEntity,
);
EXPECT_EQ(exc.GetExternalErrorBody(), "The provided password is too short");
EXPECT_THAT(exc.what(), testing::HasSubstr("Client error"));
}
Definition at line 42 of file http_error.hpp.
◆ GetCode()
◆ GetDetails()
◆ GetExternalErrorBody()
const std::string & server::handlers::CustomHandlerException::GetExternalErrorBody |
( |
| ) |
const |
|
inlineinherited |
◆ GetExtraHeaders()
const Headers & server::handlers::CustomHandlerException::GetExtraHeaders |
( |
| ) |
const |
|
inlineinherited |
◆ GetHttpStatus()
HttpStatus server::http::CustomHandlerException::GetHttpStatus |
( |
| ) |
const |
|
inline |
◆ GetServiceCode()
const std::string & server::handlers::CustomHandlerException::GetServiceCode |
( |
| ) |
const |
|
inlineinherited |
◆ IsExternalErrorBodyFormatted()
bool server::handlers::CustomHandlerException::IsExternalErrorBodyFormatted |
( |
| ) |
const |
|
inlineinherited |
The documentation for this class was generated from the following file: