proxygen
proxygen::Exception Class Reference

#include <Exception.h>

Inheritance diagram for proxygen::Exception:
proxygen::HTTPException

Public Member Functions

 Exception (std::string const &msg)
 
 Exception (const Exception &)
 
 Exception (Exception &other)
 
 Exception (Exception &&) noexcept
 
template<typename... Args>
 Exception (Args &&...args)
 
 ~Exception (void) noexceptoverride
 
const char * what (void) const noexceptoverride
 
void setCode (int code)
 
int getCode () const
 
bool hasProxygenError () const
 
void setProxygenError (ProxygenError proxygenError)
 
ProxygenError getProxygenError () const
 

Private Attributes

const std::string msg_
 
int code_
 
ProxygenError proxygenError_ {kErrorNone}
 

Detailed Description

Base class for all exceptions.

Definition at line 22 of file Exception.h.

Constructor & Destructor Documentation

Exception::Exception ( std::string const &  msg)
explicit

Definition at line 14 of file Exception.cpp.

Referenced by Exception().

14 : msg_(msg), code_(0) {}
const std::string msg_
Definition: Exception.h:53
Exception::Exception ( const Exception other)

Definition at line 16 of file Exception.cpp.

17  : msg_(other.msg_),
18  code_(other.code_),
19  proxygenError_(other.proxygenError_) {}
const std::string msg_
Definition: Exception.h:53
ProxygenError proxygenError_
Definition: Exception.h:55
proxygen::Exception::Exception ( Exception other)
inline

Definition at line 26 of file Exception.h.

References testing::Args(), Exception(), and folly::pushmi::__adl::noexcept().

26 : Exception(folly::as_const(other)) {} // @nolint
Exception(std::string const &msg)
Definition: Exception.cpp:14
constexpr T const & as_const(T &t) noexcept
Definition: Utility.h:96
Exception::Exception ( Exception &&  other)
noexcept

Definition at line 21 of file Exception.cpp.

22  : msg_(other.msg_),
23  code_(other.code_),
24  proxygenError_(other.proxygenError_) {}
const std::string msg_
Definition: Exception.h:53
ProxygenError proxygenError_
Definition: Exception.h:55
template<typename... Args>
proxygen::Exception::Exception ( Args &&...  args)
inlineexplicit

Definition at line 30 of file Exception.h.

31  : msg_(folly::to<std::string>(std::forward<Args>(args)...)), code_(0) {}
const std::string msg_
Definition: Exception.h:53
proxygen::Exception::~Exception ( void  )
inlineoverridenoexcept

Definition at line 33 of file Exception.h.

References folly::pushmi::__adl::noexcept(), and what().

33 {}

Member Function Documentation

int proxygen::Exception::getCode ( ) const
inline

Definition at line 41 of file Exception.h.

References code_.

41 { return code_; }
bool proxygen::Exception::hasProxygenError ( ) const
inline

Definition at line 44 of file Exception.h.

References proxygen::kErrorNone, and proxygenError_.

Referenced by TEST_F().

44 { return (proxygenError_ != kErrorNone); }
ProxygenError proxygenError_
Definition: Exception.h:55
void proxygen::Exception::setCode ( int  code)
inline

Definition at line 39 of file Exception.h.

References code_.

39 { code_ = code; }
const char * Exception::what ( void  ) const
overridenoexcept

Definition at line 26 of file Exception.cpp.

References msg_.

Referenced by proxygen::HTTPCodecPrinter::onError(), proxygen::HTTPSession::onSessionParseError(), proxygen::operator<<(), TEST_F(), TYPED_TEST_P(), and ~Exception().

26 { return msg_.c_str(); }
const std::string msg_
Definition: Exception.h:53

Member Data Documentation

int proxygen::Exception::code_
private

Definition at line 54 of file Exception.h.

Referenced by getCode(), and setCode().

const std::string proxygen::Exception::msg_
private

Definition at line 53 of file Exception.h.

Referenced by what().

ProxygenError proxygen::Exception::proxygenError_ {kErrorNone}
private

Definition at line 55 of file Exception.h.

Referenced by getProxygenError(), hasProxygenError(), and setProxygenError().


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