libsocket
Public Member Functions | Public Attributes | List of all members
libsocket::socket_exception Struct Reference

This class is instantiated and thrown when an error occurs. If there's an error somewhere in libsocket++, the function in which the error occurs /always/ throws a socket_exception object showing why the error occurred. More...

#include <exception.hpp>

Public Member Functions

 socket_exception (const string &file, int line, const string &message, bool show_errno=true)
 Constructor of a socket_exception object. More...
 

Public Attributes

int err
 This is the value of errno when the error occurred. More...
 
string mesg
 

Detailed Description

This class is instantiated and thrown when an error occurs. If there's an error somewhere in libsocket++, the function in which the error occurs /always/ throws a socket_exception object showing why the error occurred.

Definition at line 52 of file exception.hpp.

Constructor & Destructor Documentation

◆ socket_exception()

libsocket::socket_exception::socket_exception ( const string &  file,
int  line,
const string &  message,
bool  show_errno = true 
)

Constructor of a socket_exception object.

This constructor creates a new socket_exception object.

Parameters
fFile in which the error comes (FILE)
lLine (LINE)
mDescription of the error.

Definition at line 67 of file exception.cpp.

Member Data Documentation

◆ err

int libsocket::socket_exception::err

This is the value of errno when the error occurred.

Definition at line 53 of file exception.hpp.

◆ mesg

string libsocket::socket_exception::mesg

This is the message, showing file, line and a description. If your program is verbose, simply print it to STDERR. It contains 1. why the error occurred 2. in which file it occurred 3. in which line it occurred. It's a bit like rsync. A typical message looks like the following one: "../C++/inetclientstream.cpp:167: <<(std::string) output: Socket not connected!"

Definition at line 54 of file exception.hpp.


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