#include <userver/server/handlers/exceptions.hpp>
The generic base class for handler exceptions. Thrown exceptions should typically derive from ExceptionWithCode instead.
Definition at line 200 of file 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 | |
template<typename... Args> | |
CustomHandlerException (HandlerErrorCode handler_code, Args &&... args) | |
Construct manually from a set of (mostly optional) arguments, which describe the error details. | |
CustomHandlerException (HandlerErrorCode handler_code) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
CustomHandlerException (ServiceErrorCode service_code, ExternalBody external_body, InternalMessage internal_message, HandlerErrorCode handler_code, ExtraHeaders headers={}, formats::json::Value details={}) | |
template<typename MessageBuilder , typename = std::enable_if_t<impl::kIsMessageBuilder<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 |
Definition at line 206 of file exceptions.hpp.
Definition at line 207 of file exceptions.hpp.
Definition at line 203 of file exceptions.hpp.
Definition at line 205 of file exceptions.hpp.
Definition at line 204 of file exceptions.hpp.
|
inline |
Construct manually from a set of (mostly optional) arguments, which describe the error details.
Example:
A message builder is a class that satisfies the following requirements:
GetExternalBody() const
function to form an external bodykIsExternalBodyFormatted
set to true to forbid changing the external bodyGetServiceCode() const
function to return machine readable error codeGetInternalMessage() const
function to form an message for logging an errorSome message builder data can be overridden by explicitly passed args, if these args go after the message builder.
Example:
Definition at line 243 of file exceptions.hpp.
|
inlineexplicit |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 247 of file exceptions.hpp.
|
inline |
Definition at line 251 of file exceptions.hpp.
|
inline |
Definition at line 269 of file exceptions.hpp.
|
inline |
Definition at line 286 of file exceptions.hpp.
|
inline |
Definition at line 294 of file exceptions.hpp.
|
inline |
Definition at line 292 of file exceptions.hpp.
|
inline |
Definition at line 296 of file exceptions.hpp.
|
inline |
Definition at line 288 of file exceptions.hpp.
|
inline |
Definition at line 290 of file exceptions.hpp.