Base class for handler exceptions. More...
#include <userver/server/handlers/exceptions.hpp>
Public Types | |
using | HandlerErrorCode = handlers::HandlerErrorCode |
using | ServiceErrorCode = handlers::ServiceErrorCode |
using | InternalMessage = handlers::InternalMessage |
using | ExternalBody = handlers::ExternalBody |
using | ExtraHeaders = handlers::ExtraHeaders |
Public Member Functions | |
CustomHandlerException (impl::CustomHandlerExceptionData data) | |
CustomHandlerException (ServiceErrorCode service_code, ExternalBody external_body, InternalMessage internal_message, HandlerErrorCode handler_code, ExtraHeaders headers={}, formats::json::Value details={}) | |
template<typename MessageBuilder > | |
CustomHandlerException (MessageBuilder &&builder, HandlerErrorCode handler_code) | |
HandlerErrorCode | GetCode () const |
const std::string & | GetServiceCode () const |
bool | IsExternalErrorBodyFormatted () const |
const std::string & | GetExternalErrorBody () const |
const formats::json::Value & | GetDetails () const |
const Headers & | GetExtraHeaders () const |
Static Public Attributes | |
static constexpr HandlerErrorCode | kDefaultCode |
Base class for handler exceptions.
For consructing the body of an exception a special message builder type could be used. Message builder should satisfy the following requirements:
kIsExternalBodyFormatted
set to true to forbid changing the external bodyGetServiceCode()
function to return machine readable error codeGetExternalBody() const
function to form an external bodyGetInternalMessage() const
function to form an message for logging an errorExample:
Definition at line 234 of file exceptions.hpp.
Definition at line 240 of file exceptions.hpp.
Definition at line 241 of file exceptions.hpp.
Definition at line 237 of file exceptions.hpp.
Definition at line 239 of file exceptions.hpp.
Definition at line 238 of file exceptions.hpp.
|
inline |
Definition at line 246 of file exceptions.hpp.
|
inline |
Definition at line 256 of file exceptions.hpp.
|
inline |
Definition at line 268 of file exceptions.hpp.
|
inline |
Definition at line 273 of file exceptions.hpp.
|
inline |
Definition at line 285 of file exceptions.hpp.
|
inline |
Definition at line 281 of file exceptions.hpp.
|
inline |
Definition at line 287 of file exceptions.hpp.
|
inline |
Definition at line 275 of file exceptions.hpp.
|
inline |
Definition at line 277 of file exceptions.hpp.
|
staticconstexpr |
Definition at line 243 of file exceptions.hpp.