diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-20 09:24:06 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-20 09:24:06 +0100 |
commit | cd5ecf7b381ebc76196931e213c92664c3443be8 (patch) | |
tree | 0f8beca5b6e7c62ff503c0b8fcfcd12bcc91a1be /examples | |
parent | 9e8d4bac334e727368ada48676a21d52030b97cc (diff) | |
download | sink-cd5ecf7b381ebc76196931e213c92664c3443be8.tar.gz sink-cd5ecf7b381ebc76196931e213c92664c3443be8.zip |
Make error codes part of the applicationdomain interface
Diffstat (limited to 'examples')
-rw-r--r-- | examples/imapresource/imapresource.cpp | 4 | ||||
-rw-r--r-- | examples/mailtransportresource/mailtransportresource.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index fff4dc7..b27c2b2 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -488,7 +488,7 @@ public: | |||
488 | SinkWarning() << "Error during folder sync: " << error.errorMessage; | 488 | SinkWarning() << "Error during folder sync: " << error.errorMessage; |
489 | } | 489 | } |
490 | return imap->logout() | 490 | return imap->logout() |
491 | .then(KAsync::error(error)); | 491 | .then(KAsync::error(ApplicationDomain::LoginError, error.errorMessage)); |
492 | }); | 492 | }); |
493 | } else if (query.type() == ApplicationDomain::getTypeName<ApplicationDomain::Mail>()) { | 493 | } else if (query.type() == ApplicationDomain::getTypeName<ApplicationDomain::Mail>()) { |
494 | //TODO | 494 | //TODO |
@@ -560,7 +560,7 @@ public: | |||
560 | SinkWarning() << "Error during sync: " << error.errorMessage; | 560 | SinkWarning() << "Error during sync: " << error.errorMessage; |
561 | } | 561 | } |
562 | return imap->logout() | 562 | return imap->logout() |
563 | .then(KAsync::error(error)); | 563 | .then(KAsync::error(ApplicationDomain::LoginError, error.errorMessage)); |
564 | }); | 564 | }); |
565 | } | 565 | } |
566 | return KAsync::error<void>("Nothing to do"); | 566 | return KAsync::error<void>("Nothing to do"); |
diff --git a/examples/mailtransportresource/mailtransportresource.cpp b/examples/mailtransportresource/mailtransportresource.cpp index 72fe59d..6beb4e8 100644 --- a/examples/mailtransportresource/mailtransportresource.cpp +++ b/examples/mailtransportresource/mailtransportresource.cpp | |||
@@ -81,10 +81,10 @@ public: | |||
81 | } | 81 | } |
82 | if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), settings.password.toUtf8(), settings.cacert.toUtf8(), options)) { | 82 | if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), settings.password.toUtf8(), settings.cacert.toUtf8(), options)) { |
83 | SinkWarning() << "Failed to send message: " << mail; | 83 | SinkWarning() << "Failed to send message: " << mail; |
84 | emitNotification(Notification::Warning, Notification::TransmissionFailed, "Failed to send message."); | 84 | emitNotification(Notification::Warning, ApplicationDomain::TransmissionError, "Failed to send message."); |
85 | return KAsync::error("Failed to send the message."); | 85 | return KAsync::error("Failed to send the message."); |
86 | } else { | 86 | } else { |
87 | emitNotification(Notification::Info, Notification::TransmissionSucceeded, "Message successfully sent."); | 87 | emitNotification(Notification::Info, ApplicationDomain::TransmissionSuccess, "Message successfully sent."); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | syncStore().writeValue(mail.identifier(), "sent"); | 90 | syncStore().writeValue(mail.identifier(), "sent"); |