Skip to content

Commit

Permalink
Don't exit server loop when failing to connect to client
Browse files Browse the repository at this point in the history
  • Loading branch information
ff14wed committed Mar 9, 2023
1 parent a5cc8cf commit f77ab69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};

use anyhow::{format_err, Error, Result};
use anyhow::{Error, Result};

use futures::{SinkExt, Stream, StreamExt};

Expand Down Expand Up @@ -372,11 +372,11 @@ where
let handler = payload_handler.clone();
tokio::spawn(async move {
if let Err(e) = process(state, stream, handler).await {
error!("error occurred processing stream = {:?}", e);
error!("Error occurred when processing stream = {:?}", e);
}
});
}
Err(e) => return Err(format_err!("Unable to connect to client: {}", e)),
Err(e) => error!("Unable to connect to client: {}", e),
}
}
Ok(())
Expand Down

0 comments on commit f77ab69

Please sign in to comment.