From 1aeb24a13bea39fb8ac430b2cdf8da629da17e14 Mon Sep 17 00:00:00 2001 From: libec Date: Mon, 9 Nov 2015 08:11:31 +0100 Subject: Proper error handling in IMAPSession::customCommand --- src/core/imap/MCIMAPSession.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp index cbd94a2b..e8603114 100755 --- a/src/core/imap/MCIMAPSession.cpp +++ b/src/core/imap/MCIMAPSession.cpp @@ -1001,8 +1001,17 @@ String * IMAPSession::customCommand(String * command, ErrorCode * pError) int r; r = mailimap_custom_command(mImap, MCUTF8(command)); - if (r == MAILIMAP_ERROR_CUSTOM_COMMAND) { - * pError = ErrorCustomCommand; + if (r == MAILIMAP_ERROR_STREAM) { + mShouldDisconnect = true; + * pError = ErrorConnection; + return NULL; + } + else if (r == MAILIMAP_ERROR_PARSE) { + * pError = ErrorParse; + return NULL; + } + else if (hasError(r)) { + * pError = ErrorDelete; return NULL; } -- cgit v1.2.3