#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.
Inheritance diagram for server::handlers::CustomHandlerException: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 248 of file exceptions.hpp.
|
inline |
Definition at line 253 of file exceptions.hpp.
|
inline |
Definition at line 273 of file exceptions.hpp.
|
inline |
Definition at line 291 of file exceptions.hpp.
|
inline |
Definition at line 299 of file exceptions.hpp.
|
inline |
Definition at line 297 of file exceptions.hpp.
|
inline |
Definition at line 301 of file exceptions.hpp.
|
inline |
Definition at line 293 of file exceptions.hpp.
|
inline |
Definition at line 295 of file exceptions.hpp.