Skip to content

Commit

Permalink
error handle
Browse files Browse the repository at this point in the history
Signed-off-by: Asra Ali <[email protected]>
  • Loading branch information
asraa committed Feb 22, 2021
1 parent 63ac1ba commit f175ad7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/common/network/connection_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,6 @@ void ConnectionImpl::onWriteReady() {
socklen_t error_size = sizeof(error);
Api::SysCallIntResult result =
socket_->getSocketOption(SOL_SOCKET, SO_ERROR, &error, &error_size);
RELEASE_ASSERT(result.rc_ == 0,
fmt::format("Failed to connect: {}", errorDetails(result.errno_)));

if (error == 0) {
ENVOY_CONN_LOG(debug, "connected", *this);
Expand All @@ -669,7 +667,8 @@ void ConnectionImpl::onWriteReady() {
return;
}
} else {
ENVOY_CONN_LOG(debug, "delayed connection error: {}", *this, error);
ENVOY_BUG(result.rc_ == 0, fmt::format("failed to connect: {}", errorDetails(result.errno_)));
ENVOY_CONN_LOG(debug, "delayed connection error: {}", *this, errorDetails(result.errno_));
closeSocket(ConnectionEvent::RemoteClose);
return;
}
Expand Down

0 comments on commit f175ad7

Please sign in to comment.