Revert "Remove remaining references to fail_with"

This reverts commit 5e4bf804aa.
This commit is contained in:
teor 2021-02-23 10:54:48 +10:00 committed by Jane Lusby
parent 3c225550ee
commit 663ed6c842
1 changed files with 5 additions and 5 deletions

View File

@ -783,9 +783,9 @@ where
/// Given a `req` originating from the peer, drive it to completion and send /// Given a `req` originating from the peer, drive it to completion and send
/// any appropriate messages to the remote peer. If an error occurs while /// any appropriate messages to the remote peer. If an error occurs while
/// processing the request (e.g., the service is shedding load), then we /// processing the request (e.g., the service is shedding load), then we call
/// return a peer error, which terminates the entire peer connection, /// fail_with to terminate the entire peer connection, shrinking the number
/// shrinking the number of connected peers. /// of connected peers.
async fn drive_peer_request(&mut self, req: Request) -> Result<(), PeerError> { async fn drive_peer_request(&mut self, req: Request) -> Result<(), PeerError> {
trace!(?req); trace!(?req);
use tower::{load_shed::error::Overloaded, ServiceExt}; use tower::{load_shed::error::Overloaded, ServiceExt};
@ -805,8 +805,8 @@ where
} else { } else {
// We could send a reject to the remote peer, but that might cause // We could send a reject to the remote peer, but that might cause
// them to disconnect, and we might be using them to sync blocks. // them to disconnect, and we might be using them to sync blocks.
// For similar reasons, we don't return an error - we only close // For similar reasons, we don't want to fail_with() here - we
// the connection if the peer is doing something wrong. // only close the connection if the peer is doing something wrong.
error!(%e, error!(%e,
connection_state = ?self.state, connection_state = ?self.state,
client_receiver = ?self.client_rx, client_receiver = ?self.client_rx,