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::websockets::client::websocket_exception Class Reference

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

#include <ws_client.h>

Inheritance diagram for web::websockets::client::websocket_exception:

Public Member Functions

 websocket_exception (const utility::string_t &whatArg)
 Creates an websocket_exception with just a string message and no error code. More...
 
 websocket_exception (int errorCode)
 Creates a websocket_exception 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...
 
 websocket_exception (int errorCode, const utility::string_t &whatArg)
 Creates a websocket_exception from a error code using the current platform error category. More...
 
 websocket_exception (int errorCode, const std::error_category &cat)
 Creates a websocket_exception from a error code and category. The message of the error code will be used as the what string message. More...
 
 websocket_exception (std::error_code code, const utility::string_t &whatArg)
 Creates a websocket_exception from a error code and string message to use as the what() argument.

Parameters
codeError code.
whatArgMessage to use in what() string.
More...
 
const char * what () const CPPREST_NOEXCEPT
 Gets a string identifying the cause of the exception. More...
 
const std::error_code & error_code () const CPPREST_NOEXCEPT
 Gets the underlying error code for the cause of the exception. More...
 

Detailed Description

Represents a websocket error. This class holds an error message and an optional error code.

Constructor & Destructor Documentation

web::websockets::client::websocket_exception::websocket_exception ( const utility::string_t &  whatArg)
inline

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

Parameters
whatArgError message string.
web::websockets::client::websocket_exception::websocket_exception ( int  errorCode)
inline

Creates a websocket_exception 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::websockets::client::websocket_exception::websocket_exception ( int  errorCode,
const utility::string_t &  whatArg 
)
inline

Creates a websocket_exception from a error code using the current platform error category.

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

Creates a websocket_exception 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.
web::websockets::client::websocket_exception::websocket_exception ( std::error_code  code,
const utility::string_t &  whatArg 
)
inline

Creates a websocket_exception from a error code and string message to use as the what() argument.

Parameters
codeError code.
whatArgMessage to use in what() string.

Member Function Documentation

const std::error_code& web::websockets::client::websocket_exception::error_code ( ) const
inline

Gets the underlying error code for the cause of the exception.

Returns
The error_code object associated with the exception.
const char* web::websockets::client::websocket_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: