Package io.vertx.ext.mail
Class SMTPException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.vertx.core.VertxException
-
- io.vertx.ext.mail.SMTPException
-
- All Implemented Interfaces:
Serializable
public class SMTPException extends VertxException
This represents an Exception during communication with SMTP server.- Author:
- Lin Gao
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SMTPException.EnhancedStatus
The Enhanced Status codes.
-
Constructor Summary
Constructors Constructor Description SMTPException(String message, int replyCode, List<String> replyMessages, boolean supportEnhancementStatusCode)
Constructor of SMTPException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SMTPException.EnhancedStatus
getEnhancedStatus()
EnhancedStatus of the exception.int
getReplyCode()
Gets the SMTP reply status code.String
getReplyMessage()
Gets the SMTP reply message.List<String>
getReplyMessages()
Gets the SMTP reply messages.boolean
isPermanent()
Checks if it is a permanent failure, that the reply status code>=
500boolean
isTransient()
Checks if it is a transient failure, that the reply status code>=
400 and<
500-
Methods inherited from class io.vertx.core.VertxException
noStackTrace, noStackTrace, noStackTrace
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
SMTPException
public SMTPException(String message, int replyCode, List<String> replyMessages, boolean supportEnhancementStatusCode)
Constructor of SMTPException.- Parameters:
message
- the informative message prepending the reply messagesreplyCode
- the SMTP reply codesupportEnhancementStatusCode
- ifENHANCEDSTATUSCODES
is supported or notreplyMessages
- the SMTP reply messages
-
-
Method Detail
-
getReplyCode
public int getReplyCode()
Gets the SMTP reply status code.- Returns:
- the SMTP reply status code.
-
getReplyMessages
public List<String> getReplyMessages()
Gets the SMTP reply messages. It maybe multi lines messages splits by\n
- Returns:
- the SMTP reply messages
-
getReplyMessage
public String getReplyMessage()
Gets the SMTP reply message. In case of multi lines messages, returns the first line.- Returns:
- the SMTP reply message
-
isPermanent
public boolean isPermanent()
Checks if it is a permanent failure, that the reply status code>=
500- Returns:
- true if it is a permanent failure, false otherwise.
-
isTransient
public boolean isTransient()
Checks if it is a transient failure, that the reply status code>=
400 and<
500- Returns:
- true if it is a transient failure, false otherwise.
-
getEnhancedStatus
public SMTPException.EnhancedStatus getEnhancedStatus()
EnhancedStatus of the exception.- Returns:
- the EnhancedStatus.
-
-