97 explicit SocketException(
const int code,
const std::string& message =
"SocketException")
198 std::ostringstream oss;
199 oss << msg <<
" (error code " << code <<
")";
SocketException(const std::string &message, std::exception_ptr nested)
Constructs a SocketException with a message and a nested exception.
Definition SocketException.hpp:127
int getErrorCode() const noexcept
Retrieves the platform-specific error code associated with this exception.
Definition SocketException.hpp:144
std::exception_ptr getNestedException() const noexcept
Retrieves the nested exception captured at construction time, if any.
Definition SocketException.hpp:164
std::exception_ptr _nested
Captured nested exception for chaining, if any.
Definition SocketException.hpp:180
SocketException(const int code, const std::string &message="SocketException")
Constructs a SocketException with a platform-specific error code and custom message.
Definition SocketException.hpp:97
~SocketException() override=default
Destroys the SocketException.
static std::string buildErrorMessage(const std::string &msg, const int code)
Builds a formatted error message combining a textual description and an error code.
Definition SocketException.hpp:196
int _errorCode
Platform-specific error code (e.g., errno, WSA error).
Definition SocketException.hpp:179
Common platform and utility includes for jsocketpp.
SocketException(const std::string &message="SocketException")
Constructs a SocketException with a custom error message and no associated error code.
Definition SocketException.hpp:77
A C++ socket library providing Java-style networking interfaces.
Definition BufferView.hpp:16