#include <userver/server/handlers/exceptions.hpp>
The generic base class for handler exceptions. Thrown exceptions should typically derive from ExceptionWithCode instead.
Definition at line 195 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> 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 |
Definition at line 201 of file exceptions.hpp.
Definition at line 202 of file exceptions.hpp.
Definition at line 198 of file exceptions.hpp.
Definition at line 200 of file exceptions.hpp.
Definition at line 199 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 238 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 243 of file exceptions.hpp.
|
inline |
Definition at line 248 of file exceptions.hpp.
|
inline |
Definition at line 269 of file exceptions.hpp.
|
inline |
Definition at line 287 of file exceptions.hpp.
|
inline |
Definition at line 295 of file exceptions.hpp.
|
inline |
Definition at line 293 of file exceptions.hpp.
|
inline |
Definition at line 297 of file exceptions.hpp.
|
inline |
Definition at line 289 of file exceptions.hpp.
|
inline |
Definition at line 291 of file exceptions.hpp.