#include <userver/server/handlers/exceptions.hpp>
The generic base class for handler exceptions. Thrown exceptions should typically derive from ExceptionWithCode instead.
Definition at line 210 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 216 of file exceptions.hpp.
Definition at line 217 of file exceptions.hpp.
Definition at line 213 of file exceptions.hpp.
Definition at line 215 of file exceptions.hpp.
Definition at line 214 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 253 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 258 of file exceptions.hpp.
|
inline |
Definition at line 263 of file exceptions.hpp.
|
inline |
Definition at line 278 of file exceptions.hpp.
|
inline |
Definition at line 294 of file exceptions.hpp.
|
inline |
Definition at line 306 of file exceptions.hpp.
|
inline |
Definition at line 302 of file exceptions.hpp.
|
inline |
Definition at line 308 of file exceptions.hpp.
|
inline |
Definition at line 296 of file exceptions.hpp.
|
inline |
Definition at line 298 of file exceptions.hpp.