C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Public Member Functions | List of all members
web::http::http_exception Class Reference

Represents an HTTP error. This class holds an error message and an optional error code. More...

#include <http_msg.h>

Inheritance diagram for web::http::http_exception:

Public Member Functions

 http_exception (const utility::string_t &whatArg)
 Creates an http_exception with just a string message and no error code. More...
 
 http_exception (int errorCode)
 Creates an http_exception with from a error code using the current platform error category. The message of the error code will be used as the what() string message. More...
 
 http_exception (int errorCode, const utility::string_t &whatArg)
 Creates an http_exception with from a error code using the current platform error category. More...
 
 http_exception (int errorCode, const std::error_category &cat)
 Creates an http_exception with from a error code and category. The message of the error code will be used as the what string message. More...
 
const char * what () const CPPREST_NOEXCEPT
 Gets a string identifying the cause of the exception. More...
 
const std::error_code & error_code () const
 Retrieves the underlying error code causing this exception. More...
 

Detailed Description

Represents an HTTP error. This class holds an error message and an optional error code.

Constructor & Destructor Documentation

web::http::http_exception::http_exception ( const utility::string_t &  whatArg)
inline

Creates an http_exception with just a string message and no error code.

Parameters
whatArgError message string.
web::http::http_exception::http_exception ( int  errorCode)
inline

Creates an http_exception with from a error code using the current platform error category. The message of the error code will be used as the what() string message.

Parameters
errorCodeError code value.
web::http::http_exception::http_exception ( int  errorCode,
const utility::string_t &  whatArg 
)
inline

Creates an http_exception with from a error code using the current platform error category.

Parameters
errorCodeError code value.
whatArgMessage to use in what() string.
web::http::http_exception::http_exception ( int  errorCode,
const std::error_category &  cat 
)
inline

Creates an http_exception with from a error code and category. The message of the error code will be used as the what string message.

Parameters
errorCodeError code value.
catError category for the code.

Member Function Documentation

const std::error_code& web::http::http_exception::error_code ( ) const
inline

Retrieves the underlying error code causing this exception.

Returns
A std::error_code.
const char* web::http::http_exception::what ( ) const
inline

Gets a string identifying the cause of the exception.

Returns
A null terminated character string.

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