mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
configure: emit errors via DC_EVENT_CONFIGURE_PROGRESS
Node test expects progress to report either success or error eventually. Also update the error text expected by node test.
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
- set a default error if NDN does not provide an error
|
- set a default error if NDN does not provide an error
|
||||||
- python: avoid exceptions when messages/contacts/chats are compared with `None`
|
- python: avoid exceptions when messages/contacts/chats are compared with `None`
|
||||||
- node: wait for the event loop to stop before destroying contexts #3431
|
- node: wait for the event loop to stop before destroying contexts #3431
|
||||||
|
- emit configuration errors via event on failure #3433
|
||||||
|
|
||||||
### API-Changes
|
### API-Changes
|
||||||
- python: added `Message.get_status_updates()` #3416
|
- python: added `Message.get_status_updates()` #3416
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ describe('Basic offline Tests', function () {
|
|||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
context.configure({ addr: 'delta1@delta.localhost' })
|
context.configure({ addr: 'delta1@delta.localhost' })
|
||||||
).to.eventually.be.rejectedWith('Please enter a password.')
|
).to.eventually.be.rejectedWith('Missing (IMAP) password.')
|
||||||
await expect(context.configure({ mailPw: 'delta1' })).to.eventually.be
|
await expect(context.configure({ mailPw: 'delta1' })).to.eventually.be
|
||||||
.rejected
|
.rejected
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,24 @@ impl Context {
|
|||||||
}))
|
}))
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
if let Err(err) = res.as_ref() {
|
||||||
|
progress!(
|
||||||
|
self,
|
||||||
|
0,
|
||||||
|
Some(
|
||||||
|
stock_str::configuration_failed(
|
||||||
|
self,
|
||||||
|
// We are using Anyhow's .context() and to show the
|
||||||
|
// inner error, too, we need the {:#}:
|
||||||
|
format!("{:#}", err),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
progress!(self, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
self.free_ongoing().await;
|
self.free_ongoing().await;
|
||||||
|
|
||||||
res
|
res
|
||||||
@@ -114,31 +132,11 @@ impl Context {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
match success {
|
success?;
|
||||||
Ok(_) => {
|
|
||||||
self.set_config(Config::NotifyAboutWrongPw, Some("1"))
|
self.set_config(Config::NotifyAboutWrongPw, Some("1"))
|
||||||
.await?;
|
.await?;
|
||||||
progress!(self, 1000);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
Err(err) => {
|
|
||||||
progress!(
|
|
||||||
self,
|
|
||||||
0,
|
|
||||||
Some(
|
|
||||||
stock_str::configuration_failed(
|
|
||||||
self,
|
|
||||||
// We are using Anyhow's .context() and to show the
|
|
||||||
// inner error, too, we need the {:#}:
|
|
||||||
format!("{:#}", err),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
)
|
|
||||||
);
|
|
||||||
Err(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> {
|
async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> {
|
||||||
|
|||||||
Reference in New Issue
Block a user