The code that works if you want to use the ? operator:
while let Some(user_incoming) = incoming.try_next().await? {
let _ = &users.push(user_incoming);
}
But I want to handle the error locally, not just bubble it up.
So I came up with :
while let Ok(user_incoming) = incoming.try_next().await {
if let Some(user_incoming) = user_incoming {
let _ = &users.push(user_incoming);
} else {
println!("We got all user and now got None");
break;
}
}
And although this works without the ? operator. The error could occurr on the
try_next.await ... .
How can I get the error?
Thank you in advance,
Alex