Skip to content

Commit a45c6be

Browse files
committed
chore: print error for accept
1 parent e0524f9 commit a45c6be

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

datafusion-postgres/src/lib.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,20 @@ pub async fn serve(
5151

5252
// Accept incoming connections
5353
loop {
54-
if let Ok((socket, addr)) = listener.accept().await {
55-
let factory_ref = factory.clone();
56-
println!("Accepted connection from {}", addr);
54+
match listener.accept().await {
55+
Ok((socket, addr)) => {
56+
let factory_ref = factory.clone();
57+
println!("Accepted connection from {}", addr);
5758

58-
tokio::spawn(async move {
59-
if let Err(e) = process_socket(socket, None, factory_ref).await {
60-
eprintln!("Error processing socket: {}", e);
61-
}
62-
});
63-
};
59+
tokio::spawn(async move {
60+
if let Err(e) = process_socket(socket, None, factory_ref).await {
61+
eprintln!("Error processing socket: {}", e);
62+
}
63+
});
64+
}
65+
Err(e) => {
66+
eprintln!("Error accept socket: {}", e);
67+
}
68+
}
6469
}
6570
}

0 commit comments

Comments
 (0)