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.
This commit is contained in:
parent
c552633adb
commit
e286e9dea6
2 changed files with 3 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue