From 658fcc26b54eabcdb4bd1dea57a8f7191cdffe2e Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Wed, 24 Aug 2005 20:47:13 +0000 Subject: Error handling in posixSocket::send(). --- src/exception.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/exception.cpp') diff --git a/src/exception.cpp b/src/exception.cpp index 5090e4fe..a8479b82 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -328,13 +328,27 @@ exception* net_exception::clone() const { return new net_exception(*this); } const char* net_exception::name() const throw() { return "net_exception"; } +// +// socket_exception +// + +socket_exception::~socket_exception() throw() {} +socket_exception::socket_exception(const string& what, const exception& other) + : net_exception(what.empty() + ? "Socket error." + : "Socket error: '" + what + "'.", other) {} + +exception* socket_exception::clone() const { return new socket_exception(*this); } +const char* socket_exception::name() const throw() { return "socket_exception"; } + + // // connection_error // connection_error::~connection_error() throw() {} connection_error::connection_error(const string& what, const exception& other) - : net_exception(what.empty() + : socket_exception(what.empty() ? "Connection error." : "Connection error: '" + what + "'.", other) {} -- cgit v1.2.3