userver: server::handlers::ClientError Class Reference
Loading...
Searching...
No Matches
server::handlers::ClientError Class Reference

#include <userver/server/handlers/exceptions.hpp>

Detailed Description

Exception class for situations when request preconditions have failed. Corresponds to HTTP code 400.

Examples
postgresql/functional_tests/basic_chaos/postgres_service.cpp, samples/postgres_service/postgres_service.cpp, and samples/redis_service/redis_service.cpp.

Definition at line 334 of file exceptions.hpp.

+ Inheritance diagram for server::handlers::ClientError:
+ Collaboration diagram for server::handlers::ClientError:

Additional Inherited Members

- Public Types inherited from server::handlers::ExceptionWithCode< HandlerErrorCode::kClientError >
using BaseType
 
- Public Types inherited from server::handlers::CustomHandlerException
using HandlerErrorCode = handlers::HandlerErrorCode
 
using ServiceErrorCode = handlers::ServiceErrorCode
 
using InternalMessage = handlers::InternalMessage
 
using ExternalBody = handlers::ExternalBody
 
using ExtraHeaders = handlers::ExtraHeaders
 
- Public Member Functions inherited from server::handlers::ExceptionWithCode< HandlerErrorCode::kClientError >
 ExceptionWithCode (const ExceptionWithCode< Code > &)=default
 
 ExceptionWithCode (ExceptionWithCode< Code > &&) noexcept=default
 
 ExceptionWithCode (Args &&... args)
 
- Public Member Functions inherited from server::handlers::CustomHandlerException
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::ValueGetDetails () const
 
const Headers & GetExtraHeaders () const
 
- Static Public Attributes inherited from server::handlers::ExceptionWithCode< HandlerErrorCode::kClientError >
static constexpr HandlerErrorCode kDefaultCode
 

The documentation for this class was generated from the following file: