diff options
author | libec <libor.huspenina@gmail.com> | 2015-11-09 08:11:31 +0100 |
---|---|---|
committer | libec <libor.huspenina@gmail.com> | 2015-11-09 08:11:31 +0100 |
commit | 1aeb24a13bea39fb8ac430b2cdf8da629da17e14 (patch) | |
tree | f712ac57775e12e29f50b0ef894eb93b157d6b14 /src | |
parent | a5d3ebb7a5cfa386869b1f569538249883c5b6db (diff) |
Proper error handling in IMAPSession::customCommand
Diffstat (limited to 'src')
-rwxr-xr-x | src/core/imap/MCIMAPSession.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
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; } |