summaryrefslogtreecommitdiffstats
path: root/examples/imapresource/imapserverproxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/imapresource/imapserverproxy.cpp')
-rw-r--r--examples/imapresource/imapserverproxy.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/imapresource/imapserverproxy.cpp b/examples/imapresource/imapserverproxy.cpp
index 0cc43b8..3305f60 100644
--- a/examples/imapresource/imapserverproxy.cpp
+++ b/examples/imapresource/imapserverproxy.cpp
@@ -161,12 +161,16 @@ KAsync::Job<void> ImapServerProxy::login(const QString &username, const QString
161 // SinkTrace() << "Found user namespaces: " << mNamespaces.user; 161 // SinkTrace() << "Found user namespaces: " << mNamespaces.user;
162 }).then([=] (const KAsync::Error &error) { 162 }).then([=] (const KAsync::Error &error) {
163 if (error) { 163 if (error) {
164 if (error.errorCode == KIMAP2::LoginJob::ErrorCode::ERR_COULD_NOT_CONNECT) { 164 switch (error.errorCode) {
165 case KIMAP2::LoginJob::ErrorCode::ERR_HOST_NOT_FOUND:
166 return KAsync::error(HostNotFoundError, "Host not found: " + error.errorMessage);
167 case KIMAP2::LoginJob::ErrorCode::ERR_COULD_NOT_CONNECT:
165 return KAsync::error(CouldNotConnectError, "Failed to connect: " + error.errorMessage); 168 return KAsync::error(CouldNotConnectError, "Failed to connect: " + error.errorMessage);
166 } else if (error.errorCode == KIMAP2::LoginJob::ErrorCode::ERR_SSL_HANDSHAKE_FAILED) { 169 case KIMAP2::LoginJob::ErrorCode::ERR_SSL_HANDSHAKE_FAILED:
167 return KAsync::error(SslHandshakeError, "Ssl handshake failed: " + error.errorMessage); 170 return KAsync::error(SslHandshakeError, "Ssl handshake failed: " + error.errorMessage);
171 default:
172 return KAsync::error(error);
168 } 173 }
169 return KAsync::error(error);
170 } 174 }
171 return KAsync::null(); 175 return KAsync::null();
172 }); 176 });