#include <userver/server/handlers/exceptions.hpp>
Base class for handler exceptions. For common HandlerErrorCode values you can use more specific exception classes below. For less common HandlerErrorCode values, this class can be used directly.
Definition at line 318 of file exceptions.hpp.
Public Types | |
using | BaseType = ExceptionWithCode<kDefaultCode> |
![]() | |
using | HandlerErrorCode = handlers::HandlerErrorCode |
using | ServiceErrorCode = handlers::ServiceErrorCode |
using | InternalMessage = handlers::InternalMessage |
using | ExternalBody = handlers::ExternalBody |
using | ExtraHeaders = handlers::ExtraHeaders |
Public Member Functions | |
ExceptionWithCode (const ExceptionWithCode< Code > &)=default | |
ExceptionWithCode (ExceptionWithCode< Code > &&) noexcept=default | |
template<typename... Args> | |
ExceptionWithCode (Args &&... args) | |
![]() | |
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 |
Static Public Attributes | |
static constexpr HandlerErrorCode | kDefaultCode = Code |
using server::handlers::ExceptionWithCode< Code >::BaseType = ExceptionWithCode<kDefaultCode> |
Definition at line 321 of file exceptions.hpp.
|
inlineexplicit |
Definition at line 328 of file exceptions.hpp.
|
staticconstexpr |
Definition at line 320 of file exceptions.hpp.