MCPcopy Create free account
hub / github.com/dermesser/libsocket / socket_exception

Method socket_exception

C++/exception.cpp:67–81  ·  view source on GitHub ↗

* @brief Constructor of a socket_exception object * * This constructor creates a new socket_exception object. * * @param f File in which the error comes (__FILE__) * @param l Line (__LINE__) * @param m Description of the error. */

Source from the content-addressed store, hash-verified

65 * @param m Description of the error.
66 */
67socket_exception::socket_exception(const string& file, int line,
68 const string& message, bool show_errno) {
69 std::ostringstream message_stream;
70
71 // Saving errno here should be safe
72 err = errno;
73
74 message_stream << file << ":" << line << ": " << message;
75
76 if (show_errno) message_stream << " (" << std::strerror(errno) << ")";
77
78 message_stream << "\n";
79
80 mesg = message_stream.str();
81}
82} // namespace libsocket
83
84/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected