#include <userver/server/handlers/exceptions.hpp>
The generic base class for handler exceptions. Thrown exceptions should typically derive from ExceptionWithCode instead.
Definition at line 194 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> requires impl::IsMessageBuilder<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 |
| using server::handlers::CustomHandlerException::ExternalBody = handlers::ExternalBody |
Definition at line 200 of file exceptions.hpp.
| using server::handlers::CustomHandlerException::ExtraHeaders = handlers::ExtraHeaders |
Definition at line 201 of file exceptions.hpp.
Definition at line 197 of file exceptions.hpp.
| using server::handlers::CustomHandlerException::InternalMessage = handlers::InternalMessage |
Definition at line 199 of file exceptions.hpp.
| using server::handlers::CustomHandlerException::ServiceErrorCode = handlers::ServiceErrorCode |
Definition at line 198 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:
Some message builder data can be overridden by explicitly passed args, if these args go after the message builder.
Example:
Definition at line 237 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 242 of file exceptions.hpp.
|
inline |
Definition at line 247 of file exceptions.hpp.
|
inline |
Definition at line 268 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.