[geary/wip/fix-not-prompting-for-missing-password: 1/4] Throw errors when IMAP or SMTP services have incomplete creds
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/fix-not-prompting-for-missing-password: 1/4] Throw errors when IMAP or SMTP services have incomplete creds
- Date: Thu, 21 Feb 2019 05:02:06 +0000 (UTC)
commit e286e9dea63a57003e5b954c078f467f30681457
Author: Michael Gratton <mike vee net>
Date: Thu Feb 21 15:41:51 2019 +1100
Throw errors when IMAP or SMTP services have incomplete creds
Instead of just flagging the state, it means the error gets handled
correctly at a higher level.
src/engine/imap/api/imap-client-service.vala | 6 ++----
src/engine/smtp/smtp-client-service.vala | 2 +-
2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/engine/imap/api/imap-client-service.vala b/src/engine/imap/api/imap-client-service.vala
index 398ff8dd..fa99d478 100644
--- a/src/engine/imap/api/imap-client-service.vala
+++ b/src/engine/imap/api/imap-client-service.vala
@@ -387,16 +387,14 @@ internal class Geary.Imap.ClientService : Geary.ClientService {
debug("[%s] Opening new session", this.account.id);
Credentials? login = this.configuration.credentials;
if (login != null && !login.is_complete()) {
- notify_authentication_failed();
+ throw new ImapError.UNAUTHENTICATED("Token not loaded");
}
ClientSession new_session = new ClientSession(remote);
yield new_session.connect_async(cancellable);
try {
- yield new_session.initiate_session_async(
- this.configuration.credentials, cancellable
- );
+ yield new_session.initiate_session_async(login, cancellable);
} catch (Error err) {
// need to disconnect before throwing error ... don't
// honor Cancellable here, it's important to disconnect
diff --git a/src/engine/smtp/smtp-client-service.vala b/src/engine/smtp/smtp-client-service.vala
index 7ce305fd..e949338a 100644
--- a/src/engine/smtp/smtp-client-service.vala
+++ b/src/engine/smtp/smtp-client-service.vala
@@ -238,7 +238,7 @@ internal class Geary.Smtp.ClientService : Geary.ClientService {
throws Error {
Credentials? login = this.account.get_outgoing_credentials();
if (login != null && !login.is_complete()) {
- notify_authentication_failed();
+ throw new SmtpError.AUTHENTICATION_FAILED("Token not loaded");
}
Smtp.ClientSession smtp = new Geary.Smtp.ClientSession(this.remote);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]