Log instead of throwing exception when sending message to peer without an active connection (#5392)

This commit is contained in:
Chris Stewart 2024-02-11 09:08:05 -06:00 committed by GitHub
parent cac546bb57
commit d4ae659887
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -390,9 +390,10 @@ case class PeerConnection(peer: Peer, queue: SourceQueue[NodeStreamMessage])(
case Some(g) =>
sendMsg(msg.bytes, g.mergeHubSink)
case None =>
val exn = new RuntimeException(
s"Could not send msg=${msg.payload.commandName} because we do not have an active connection to peer=${peer} socket=$socket")
Future.failed(exn)
val log =
s"Could not send msg=${msg.payload.commandName} because we do not have an active connection to peer=${peer} socket=$socket"
logger.warn(log)
Future.unit
}
}