summaryrefslogtreecommitdiffstats
path: root/examples/imapresource
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-09 14:30:29 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-09 14:30:29 +0200
commit4da825f0429f1f125abe5f1843cd4e3ac5387346 (patch)
tree4a8c1ec704cfead0e7f53746c8b7c53916870f02 /examples/imapresource
parent7f4e3f838d2ca27a6f3910208235ec4b96725f14 (diff)
downloadsink-4da825f0429f1f125abe5f1843cd4e3ac5387346.tar.gz
sink-4da825f0429f1f125abe5f1843cd4e3ac5387346.zip
Translate the host not found error
Diffstat (limited to 'examples/imapresource')
-rw-r--r--examples/imapresource/imapresource.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp
index e7458f6..90383e0 100644
--- a/examples/imapresource/imapresource.cpp
+++ b/examples/imapresource/imapresource.cpp
@@ -506,12 +506,16 @@ public:
506 KAsync::Error getError(const KAsync::Error &error) 506 KAsync::Error getError(const KAsync::Error &error)
507 { 507 {
508 if (error) { 508 if (error) {
509 if (error.errorCode == Imap::CouldNotConnectError) { 509 switch(error.errorCode) {
510 return {ApplicationDomain::ConnectionError, error.errorMessage}; 510 case Imap::CouldNotConnectError:
511 } else if (error.errorCode == Imap::SslHandshakeError) { 511 return {ApplicationDomain::ConnectionError, error.errorMessage};
512 return {ApplicationDomain::LoginError, error.errorMessage}; 512 case Imap::SslHandshakeError:
513 return {ApplicationDomain::LoginError, error.errorMessage};
514 case Imap::HostNotFoundError:
515 return {ApplicationDomain::NoServerError, error.errorMessage};
516 default:
517 return {ApplicationDomain::UnknownError, error.errorMessage};
513 } 518 }
514 return {ApplicationDomain::UnknownError, error.errorMessage};
515 } 519 }
516 return {}; 520 return {};
517 } 521 }