diff options
author | 2015-01-05 12:55:18 -0800 | |
---|---|---|
committer | 2015-01-05 13:06:28 -0800 | |
commit | 090301ae3d2ff1dae80f340367461a3551f21c3a (patch) | |
tree | 0e8269ae518593b84ad9676fa74f56540fee7aa6 /src/java/com | |
parent | 4a140d2e935083caaf83884d3d705ba9b7cfcfad (diff) |
Implemented error message for Java
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/libmailcore/ErrorCode.java (renamed from src/java/com/libmailcore/Error.java) | 2 | ||||
-rw-r--r-- | src/java/com/libmailcore/IMAPOperation.java | 4 | ||||
-rw-r--r-- | src/java/com/libmailcore/MailException.java | 49 |
3 files changed, 4 insertions, 51 deletions
diff --git a/src/java/com/libmailcore/Error.java b/src/java/com/libmailcore/ErrorCode.java index b0c4fc40..85686411 100644 --- a/src/java/com/libmailcore/Error.java +++ b/src/java/com/libmailcore/ErrorCode.java @@ -1,6 +1,6 @@ package com.libmailcore; -public class Error { +public class ErrorCode { public final static int ErrorNone = 0; // 0 public final static int ErrorConnection = 1; public final static int ErrorTLSNotAvailable = 2; diff --git a/src/java/com/libmailcore/IMAPOperation.java b/src/java/com/libmailcore/IMAPOperation.java index 5790ec29..4fea241f 100644 --- a/src/java/com/libmailcore/IMAPOperation.java +++ b/src/java/com/libmailcore/IMAPOperation.java @@ -2,7 +2,7 @@ package com.libmailcore; public class IMAPOperation extends Operation { public MailException exception() { - if (errorCode() == Error.ErrorNone) { + if (errorCode() == ErrorCode.ErrorNone) { return null; } return new MailException(errorCode()); @@ -13,7 +13,7 @@ public class IMAPOperation extends Operation { protected void callCallback() { if (callback != null) { - if (errorCode() == Error.ErrorNone) { + if (errorCode() == ErrorCode.ErrorNone) { callback.succeeded(); } else { diff --git a/src/java/com/libmailcore/MailException.java b/src/java/com/libmailcore/MailException.java index 9c152d70..a101b3e3 100644 --- a/src/java/com/libmailcore/MailException.java +++ b/src/java/com/libmailcore/MailException.java @@ -18,54 +18,7 @@ public class MailException extends Exception { errorCode = anErrorCode; } - private static String messageForErrorCode(int errorCode) - { - return "Error"; - } - - static final int ERROR_NONE = 0; - static final int ERROR_CONNECTION = 1; - static final int ERROR_TLS_NOT_AVAILABLE = 2; - static final int ERROR_PARSE = 3; - static final int ERROR_CERTIFICATE = 4; - static final int ERROR_AUTHENTICATION = 5; - static final int ERROR_GMAIL_IMAP_NOT_ENABLED = 6; - static final int ERROR_GMAIL_EXCEED_BANDWIDTH_LIMIT = 7; - static final int ERROR_GMAIL_TOO_MANY_SIMULTANEOUS_CONNECTIONS = 8; - static final int ERROR_MOBILEME_MOVED = 9; - static final int ERROR_YAHOO_UNAVAILABLE = 10; - static final int ERROR_NON_EXISTANT_FOLDER = 11; - static final int ERROR_RENAME = 12; - static final int ERROR_DELETE = 13; - static final int ERROR_CREATE = 14; - static final int ERROR_SUBSCRIBED = 15; - static final int ERROR_APPEND = 16; - static final int ERROR_COPY = 17; - static final int ERROR_EXPUNGE = 18; - static final int ERROR_FETCH = 19; - static final int ERROR_IDLE = 20; - static final int ERROR_IDENTITY = 21; - static final int ERROR_NAMESPACE = 22; - static final int ERROR_STORE = 23; - static final int ERROR_CAPABILITY = 24; - static final int ERROR_STARTTLS_NOT_AVAILABLE = 25; - static final int ERROR_SEND_MESSAGE_ILLEGAL_ATTACHMENT = 26; - static final int ERROR_STORAGE_LIMIT = 27; - static final int ERROR_SEND_MESSAGE_NOT_ALLOWED = 28; - static final int ERROR_NEEDS_CONNECT_TO_WEBMAIL = 29; - static final int ERROR_SEND_MESSAGE = 30; - static final int ERROR_AUTHENTICATION_REQUIRED = 31; - static final int ERROR_FETCH_MESSAGE_LIST = 32; - static final int ERROR_DELETE_MESSAGE = 33; - static final int ERROR_INVALID_ACCOUNT = 34; - static final int ERROR_FILE = 35; - static final int ERROR_COMPRESSION = 36; - static final int ERROR_NO_SENDER = 37; - static final int ERROR_NO_RECIPIENT = 38; - static final int ERROR_NOOP = 39; - static final int ERROR_GMAIL_APPLICATION_SPECIFIC_PASSWORD_REQUIRED = 40; - static final int ERROR_SERVER_DATE = 41; - static final int ERROR_COUNT = 42; + private static native String messageForErrorCode(int errorCode); private int errorCode; }
\ No newline at end of file |