client: exception propagation from callbacks

Swallowing exceptions here hides some of our errors.
Particularly unrecoverable introspectionRegistry misses.
Instead, propagate up to Thread and close connection.
This commit is contained in:
Michael Davidsaver
2018-06-22 12:47:08 -07:00
parent 1670ff8f7c
commit d424202323
2 changed files with 38 additions and 47 deletions

View File

@@ -1136,6 +1136,7 @@ void BlockingTCPTransportCodec::receiveThread()
{
try {
this->processRead();
continue;
} catch (std::exception &e) {
PRINT_EXCEPTION(e);
LOG(logLevelError,
@@ -1146,6 +1147,8 @@ void BlockingTCPTransportCodec::receiveThread()
"unknown exception caught while in receiveThread at %s:%d.",
__FILE__, __LINE__);
}
// exception
close();
}
}
@@ -1161,6 +1164,7 @@ void BlockingTCPTransportCodec::sendThread()
{
try {
this->processWrite();
continue;
} catch (connection_closed_exception &cce) {
// noop
} catch (std::exception &e) {
@@ -1173,6 +1177,8 @@ void BlockingTCPTransportCodec::sendThread()
"unknown exception caught while in sendThread at %s:%d.",
__FILE__, __LINE__);
}
// exception
close();
}
_sendQueue.clear();
}