Separate timeout and connection dropped errors out (#30457)
This commit is contained in:
parent
39da72161f
commit
471e02d48f
25 changed files with 313 additions and 115 deletions
|
@ -1894,11 +1894,24 @@ impl ContextEditor {
|
|||
.log_err();
|
||||
|
||||
if let Some(client) = client {
|
||||
cx.spawn(async move |this, cx| {
|
||||
client.authenticate_and_connect(true, cx).await?;
|
||||
this.update(cx, |_, cx| cx.notify())
|
||||
cx.spawn(async move |context_editor, cx| {
|
||||
match client.authenticate_and_connect(true, cx).await {
|
||||
util::ConnectionResult::Timeout => {
|
||||
log::error!("Authentication timeout")
|
||||
}
|
||||
util::ConnectionResult::ConnectionReset => {
|
||||
log::error!("Connection reset")
|
||||
}
|
||||
util::ConnectionResult::Result(r) => {
|
||||
if r.log_err().is_some() {
|
||||
context_editor
|
||||
.update(cx, |_, cx| cx.notify())
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.detach_and_log_err(cx)
|
||||
.detach()
|
||||
}
|
||||
})),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue