* @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. */
| 65 | * @param m Description of the error. |
| 66 | */ |
| 67 | socket_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 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected