[geary/wip/131-sent-mail: 12/15] Handle Smtp.ClientService null condition better



commit fd383e59e03ddeffcd85cd76f51cf8b2ff2978bc
Author: Michael Gratton <mike vee net>
Date:   Sat Aug 10 12:07:54 2019 +1000

    Handle Smtp.ClientService null condition better

 src/engine/smtp/smtp-client-service.vala | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/engine/smtp/smtp-client-service.vala b/src/engine/smtp/smtp-client-service.vala
index 59c41ba0..a5a41ac4 100644
--- a/src/engine/smtp/smtp-client-service.vala
+++ b/src/engine/smtp/smtp-client-service.vala
@@ -137,6 +137,9 @@ internal class Geary.Smtp.ClientService : Geary.ClientService {
                 cancellable.cancel();
             } catch (GLib.IOError.CANCELLED err) {
                 // Nothing to do here — we're already cancelled.
+            } catch (EngineError.NOT_FOUND err) {
+                debug("Queued email %s not found in outbox, ignoring: %s",
+                      id.to_string(), err.message);
             } catch (GLib.Error err) {
                 notify_connection_failed(new ErrorContext(err));
                 cancellable.cancel();
@@ -194,15 +197,9 @@ internal class Geary.Smtp.ClientService : Geary.ClientService {
             throw new SmtpError.AUTHENTICATION_FAILED("Credentials not loaded");
         }
 
-        Email? email = null;
-        try {
-            email = yield this.outbox.fetch_email_async(
-                id, Email.Field.ALL, Folder.ListFlags.NONE, cancellable
-            );
-        } catch (EngineError.NOT_FOUND err) {
-            debug("Queued email %s not found in outbox, ignoring: %s",
-                  id.to_string(), err.message);
-        }
+        Email email = yield this.outbox.fetch_email_async(
+            id, Email.Field.ALL, Folder.ListFlags.NONE, cancellable
+        );
 
         if (!email.email_flags.contains(EmailFlags.OUTBOX_SENT)) {
             RFC822.Message message = email.get_message();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]