Class EmailReceiveException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.email.exception.EmailException
cloud.opencode.base.email.exception.EmailReceiveException
- All Implemented Interfaces:
Serializable
Email Receive Exception
邮件接收异常
Exception thrown when email receiving fails.
邮件接收失败时抛出的异常。
Examples | 示例:
- Connection failed - 连接失败
- Authentication failed - 认证失败
- Folder not found - 文件夹未找到
- Receive timeout - 接收超时
- Message parse failed - 消息解析失败
Features | 主要功能:
- Folder and message context tracking - 文件夹和消息上下文跟踪
- Factory methods for common receive errors - 常见接收错误的工厂方法
- Error code support - 错误码支持
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
- Since:
- JDK 25, opencode-base-email V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEmailReceiveException(String message) Create receive exception with message 使用消息创建接收异常EmailReceiveException(String message, EmailErrorCode errorCode) Create receive exception with message and error code 使用消息和错误码创建接收异常EmailReceiveException(String message, Throwable cause) Create receive exception with message and cause 使用消息和原因创建接收异常EmailReceiveException(String message, Throwable cause, EmailErrorCode errorCode) Create receive exception with message, cause and error code 使用消息、原因和错误码创建接收异常EmailReceiveException(String message, Throwable cause, EmailErrorCode errorCode, String folder, String messageId, ReceivedEmail receivedEmail) Create receive exception with full context 使用完整上下文创建接收异常 -
Method Summary
Modifier and TypeMethodDescriptionstatic EmailReceiveExceptionconnectionLost(Throwable cause) Create exception for connection lost 创建连接丢失异常static EmailReceiveExceptionfolderNotFound(String folder) Create exception for folder not found 创建文件夹未找到异常Get the folder where error occurred 获取发生错误的文件夹Get the message ID related to the error 获取与错误相关的消息IDGet the partially received email (if available) 获取部分接收的邮件(如果可用)static EmailReceiveExceptionmessageNotFound(String messageId) Create exception for message not found 创建消息未找到异常static EmailReceiveExceptionparseFailed(String messageId, Throwable cause) Create exception for message parse failure 创建消息解析失败异常static EmailReceiveExceptiontimeout()Create exception for receive timeout 创建接收超时异常Methods inherited from class EmailException
getEmail, getEmailErrorCode, isRetryableMethods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EmailReceiveException
Create receive exception with message 使用消息创建接收异常- Parameters:
message- the error message | 错误消息
-
EmailReceiveException
Create receive exception with message and error code 使用消息和错误码创建接收异常- Parameters:
message- the error message | 错误消息errorCode- the error code | 错误码
-
EmailReceiveException
-
EmailReceiveException
Create receive exception with message, cause and error code 使用消息、原因和错误码创建接收异常- Parameters:
message- the error message | 错误消息cause- the cause | 原因errorCode- the error code | 错误码
-
EmailReceiveException
public EmailReceiveException(String message, Throwable cause, EmailErrorCode errorCode, String folder, String messageId, ReceivedEmail receivedEmail) Create receive exception with full context 使用完整上下文创建接收异常- Parameters:
message- the error message | 错误消息cause- the cause | 原因errorCode- the error code | 错误码folder- the folder name | 文件夹名称messageId- the message ID | 消息IDreceivedEmail- the partial received email | 部分接收的邮件
-
-
Method Details
-
getReceivedEmail
Get the partially received email (if available) 获取部分接收的邮件(如果可用)- Returns:
- the received email or null | 接收的邮件或null
-
getFolder
Get the folder where error occurred 获取发生错误的文件夹- Returns:
- the folder name or null | 文件夹名称或null
-
getMessageId
Get the message ID related to the error 获取与错误相关的消息ID- Returns:
- the message ID or null | 消息ID或null
-
folderNotFound
Create exception for folder not found 创建文件夹未找到异常- Parameters:
folder- the folder name | 文件夹名称- Returns:
- the exception | 异常
-
messageNotFound
Create exception for message not found 创建消息未找到异常- Parameters:
messageId- the message ID | 消息ID- Returns:
- the exception | 异常
-
connectionLost
Create exception for connection lost 创建连接丢失异常- Parameters:
cause- the cause | 原因- Returns:
- the exception | 异常
-
timeout
Create exception for receive timeout 创建接收超时异常- Returns:
- the exception | 异常
-
parseFailed
Create exception for message parse failure 创建消息解析失败异常- Parameters:
messageId- the message ID | 消息IDcause- the cause | 原因- Returns:
- the exception | 异常
-