aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/abstract/MCErrorMessage.cpp
blob: c7205d4228a941403d02b42a2e1b75cd0071c2ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "MCErrorMessage.h"

using namespace mailcore;

static const char * localizedDescriptionTable[] = {
    "The operation succeeded.", /** MCOErrorNone */
    "A stable connection to the server could not be established.",                   /** MCOErrorConnection */
    "The server does not support TLS/SSL connections.",                              /** MCOErrorTLSNotAvailable */
    "Unable to parse response from server.",                                         /** MCOErrorParse */
    "The certificate for this server is invalid.",                                   /** MCOErrorCertificate */
    "Unable to authenticate with the current session's credentials.",                /** MCOErrorAuthentication */
    "IMAP is not enabled for this Gmail account.",                                   /** MCOErrorGmailIMAPNotEnabled */
    "Bandwidth limits were exceeded while requesting data from this Gmail account.", /** MCOErrorGmailExceededBandwidthLimit */
    "Too many simultaneous connections were made to this Gmail account.",            /** MCOErrorGmailTooManySimultaneousConnections */
    "MobileMe is no longer an active mail service.",                                 /** MCOErrorMobileMeMoved */
    "Yahoo!'s servers are currently unavailable.",                                   /** MCOErrorYahooUnavailable */
    "The requested folder does not exist.  Folder selection failed",                 /** MCOErrorNonExistantFolder */
    "An error occured while renaming the requested folder.",                         /** MCOErrorRename */
    "An error occured while deleting the requested folder.",                         /** MCOErrorDelete */
    "An error occured while creating the requested folder.",                         /** MCOErrorCreate */
    "An error occured while (un)subscribing to the requested folder.",               /** MCOErrorSubscribe */
    "An error occured while appending a message to the requested folder.",           /** MCOErrorAppend */
    "An error occured while copying a message to the requested folder.",             /** MCOErrorCopy */
    "An error occured while expunging a message in the requested folder.",           /** MCOErrorExpunge */
    "An error occured while fetching messages in the requested folder.",             /** MCOErrorFetch */
    "An error occured during an IDLE operation.",                                    /** MCOErrorIdle */
    "An error occured while requesting the server's identity.",                      /** MCOErrorIdentity */
    "An error occured while requesting the server's namespace.",                     /** MCOErrorNamespace */
    "An error occured while storing flags.",                                         /** MCOErrorStore */
    "An error occured while requesting the server's capabilities.",                  /** MCOErrorCapability */
    "The server does not support STARTTLS connections.",                             /** MCOErrorStartTLSNotAvailable */
    "Attempted to send a message with an illegal attachment.",                       /** MCOErrorSendMessageIllegalAttachment */
    "The SMTP storage limit was hit while trying to send a large message.",          /** MCOErrorStorageLimit */
    "Sending messages is not allowed on this server.",                               /** MCOErrorSendMessageNotAllowed */
    "The current HotMail account cannot connect to WebMail.",                        /** MCOErrorNeedsConnectToWebmail */
    "An error occured while sending the message.",                                   /** MCOErrorSendMessage */
    "Authentication is required for this SMTP server.",                              /** MCOErrorAuthenticationRequired */
    "An error occured while fetching a message list on the POP server.",             /** MCOErrorFetchMessageList */
    "An error occured while deleting a message on the POP server.",                  /** MCOErrorDeleteMessage */
    "Account check failed because the account is invalid.",                          /** MCOErrorInvalidAccount */
    "File access error",                                                             /** MCOErrorFile */
    "Compression is not available",                                                  /** MCOErrorCompression */
    "A sender is required to send message",                                          /** MCOErrorNoSender */
    "A recipient is required to send message",                                       /** MCOErrorNoRecipient */
    "An error occured while performing a No-Op operation.",                          /** MCOErrorNoop */
    "An application specific password is required",                                  /** MCOErrorGmailApplicationSpecificPasswordRequired */
};

String * mailcore::errorMessageWithErrorCode(ErrorCode errorCode)
{
    if (errorCode < 0) {
        return NULL;
    }
    if (errorCode >= sizeof(localizedDescriptionTable) / sizeof(localizedDescriptionTable[0])) {
        return NULL;
    }
    return String::stringWithUTF8Characters(localizedDescriptionTable[errorCode]);
}