diff options
author | Mathias Stearn <mathias@10gen.com> | 2018-01-17 13:31:14 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2018-01-19 21:43:07 -0500 |
commit | 6d92ce0e7ec4e9a0cf31e9f9940a63b03968bb88 (patch) | |
tree | ee06bd3cd1d5f34b114c81bffb715e432fbe6880 /src/mongo/client/dbclient.cpp | |
parent | 410d6cf705eafd46499e8b338be5103becd377ff (diff) | |
download | mongo-6d92ce0e7ec4e9a0cf31e9f9940a63b03968bb88.tar.gz |
SERVER-32674 Make SocketException not be a special type
Diffstat (limited to 'src/mongo/client/dbclient.cpp')
-rw-r--r-- | src/mongo/client/dbclient.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/client/dbclient.cpp b/src/mongo/client/dbclient.cpp index 29bdb37fcec..0f82f291d21 100644 --- a/src/mongo/client/dbclient.cpp +++ b/src/mongo/client/dbclient.cpp @@ -1037,7 +1037,7 @@ void DBClientConnection::_checkConnection() { return; if (!autoReconnect) - throw SocketException(SocketException::FAILED_STATE, toString()); + throwSocketError(SocketErrorKind::FAILED_STATE, toString()); // Don't hammer reconnects, backoff if needed autoReconnectBackoff.nextSleepMillis(); @@ -1052,7 +1052,7 @@ void DBClientConnection::_checkConnection() { if (connectStatus == ErrorCodes::IncompatibleCatalogManager) { uassertStatusOK(connectStatus); // Will always throw } else { - throw SocketException(SocketException::CONNECT_ERROR, connectStatus.reason()); + throwSocketError(SocketErrorKind::CONNECT_ERROR, connectStatus.reason()); } } @@ -1377,8 +1377,9 @@ void DBClientConnection::say(Message& toSend, bool isRetry, string* actualServer auto swm = _compressorManager.compressMessage(toSend); uassertStatusOK(swm.getStatus()); port().say(swm.getValue()); - } catch (SocketException&) { + } catch (const DBException&) { _failed = true; + _port->shutdown(); throw; } } |