// Actually send the error accross the wire. This is for when errors happen on receiving
// messages (eg. Deserialization errors).
//
// sid null is important so the remote knows that this is an error.
//
// This is currently only called from RequestError.
//
Actually send the error accross the wire. This is for when errors happen on receiving
messages .

sid null is important so the remote knows that this is an error.

This is currently only called from RequestError.
Actually send the error accross the wire . This is for when errors happen on receiving messages . sid null is important so the remote knows that this is an error . This is currently only called from RequestError .
async fn send_err
	(
		&mut self               ,
		cid  : ConnID           ,
		err  : &ConnectionError ,
		close: bool             , // whether the connection should be closed (eg stream corrupted)
	)
	{
		trace!( "{}: sending OUT ConnectionError", self.identify() );
		// If self.outgoing is None, we have already closed.
		//
		let out = match self.outgoing
		{
			Some( ref mut out ) => out,
			None                => return,
		};
		// sid null is the marker that this is an error message.
		//
		let msg = Self::prep_error( cid, err );
		// We are already trying to report an error. If we can't send, just give up.
		//
		let _ = out.send( msg ).await;
		if close
		{
			let close_conn = CloseConnection{ remote: false, reason: format!( "{:?}", err ) };
			Handler::<CloseConnection>::handle( self, close_conn ).await
		}
	}
async fn send_err ( & mut self , cid : ConnID , err : & ConnectionError , close : bool , // whether the connection should be closed (eg stream corrupted) ) { trace ! ( " " self identify ( ) ) ; // If self.outgoing is None, we have already closed. // let out = match self . outgoing { Some ( ref mut out ) => out , None => return , } ; // sid null is the marker that this is an error message. // let msg = Self :: prep_error ( cid , err ) ; // We are already trying to report an error. If we can't send, just give up. // let _ = out . send ( msg ) . await ; if close { let close_conn = CloseConnection { remote : false , reason : format ! ( " " err ) } ; Handler :: < CloseConnection > :: handle ( self , close_conn ) . await } }
Actually send the error accross the wire.
Actually send the error accross the wire .
&mut self
cid
ConnID
err
&ConnectionError
close
bool