userver: server::handlers::ExceptionWithCode< Code > Class Template Reference
Loading...
Searching...
No Matches
server::handlers::ExceptionWithCode< Code > Class Template Reference

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

Detailed Description

template<HandlerErrorCode Code>
class server::handlers::ExceptionWithCode< Code >

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.

+ Inheritance diagram for server::handlers::ExceptionWithCode< Code >:

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)
 
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

static constexpr HandlerErrorCode kDefaultCode = Code
 

Member Typedef Documentation

◆ BaseType

template<HandlerErrorCode Code>
using server::handlers::ExceptionWithCode< Code >::BaseType = ExceptionWithCode<kDefaultCode>

Definition at line 321 of file exceptions.hpp.

◆ ExternalBody

◆ ExtraHeaders

◆ HandlerErrorCode

◆ InternalMessage

◆ ServiceErrorCode

Constructor & Destructor Documentation

◆ ExceptionWithCode()

template<HandlerErrorCode Code>
template<typename... Args>
server::handlers::ExceptionWithCode< Code >::ExceptionWithCode ( Args &&... args)
inlineexplicit
See also
CustomHandlerException::CustomHandlerException for allowed args

Definition at line 328 of file exceptions.hpp.

Member Function Documentation

◆ GetCode()

HandlerErrorCode server::handlers::CustomHandlerException::GetCode ( ) const
inlineinherited

Definition at line 294 of file exceptions.hpp.

◆ GetDetails()

const formats::json::Value & server::handlers::CustomHandlerException::GetDetails ( ) const
inlineinherited

Definition at line 306 of file exceptions.hpp.

◆ GetExternalErrorBody()

const std::string & server::handlers::CustomHandlerException::GetExternalErrorBody ( ) const
inlineinherited

Definition at line 302 of file exceptions.hpp.

◆ GetExtraHeaders()

const Headers & server::handlers::CustomHandlerException::GetExtraHeaders ( ) const
inlineinherited

Definition at line 308 of file exceptions.hpp.

◆ GetServiceCode()

const std::string & server::handlers::CustomHandlerException::GetServiceCode ( ) const
inlineinherited

Definition at line 296 of file exceptions.hpp.

◆ IsExternalErrorBodyFormatted()

bool server::handlers::CustomHandlerException::IsExternalErrorBodyFormatted ( ) const
inlineinherited

Definition at line 298 of file exceptions.hpp.

Member Data Documentation

◆ kDefaultCode

template<HandlerErrorCode Code>
constexpr HandlerErrorCode server::handlers::ExceptionWithCode< Code >::kDefaultCode = Code
staticconstexpr

Definition at line 320 of file exceptions.hpp.


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