Package org.apache.commons.mail2.core
Class EmailException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.commons.mail2.core.EmailException
- All Implemented Interfaces:
Serializable
Exception thrown when a checked error occurs in commons-email.
Adapted from FunctorException in Commons Collections.
Emulation support for nested exceptions has been removed in Email 1.3, supported by JDK 1.4 and above.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newEmailExceptionwith no detail message.EmailException(String msg) Constructs a newEmailExceptionwith specified detail message.EmailException(String msg, Throwable rootCause) Constructs a newEmailExceptionwith specified detail message and nestedThrowableroot cause.EmailException(Throwable rootCause) Constructs a newEmailExceptionwith specified nestedThrowableroot cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> Vstatic <T> Tstatic StringcheckNonEmpty(String value, Supplier<String> message) static <T> Collection<T>checkNonEmpty(Collection<T> value, Supplier<String> message) static <T> T[]checkNonEmpty(T[] value, Supplier<String> message) static <T> TcheckNonNull(T test, Supplier<String> message) voidPrints the stack trace of this exception to the standard error stream.voidPrints the stack trace of this exception to the specified stream.voidPrints the stack trace of this exception to the specified writer.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
Constructor Details
-
EmailException
public EmailException()Constructs a newEmailExceptionwith no detail message. -
EmailException
Constructs a newEmailExceptionwith specified detail message.- Parameters:
msg- the error message.
-
EmailException
Constructs a newEmailExceptionwith specified detail message and nestedThrowableroot cause.- Parameters:
msg- the error message.rootCause- the exception or error that caused this exception to be thrown.
-
EmailException
Constructs a newEmailExceptionwith specified nestedThrowableroot cause.- Parameters:
rootCause- the exception or error that caused this exception to be thrown.
-
-
Method Details
-
call
- Throws:
EmailException
-
check
public static <T> T check(Supplier<Boolean> test, T subject, Supplier<String> message) throws EmailException - Throws:
EmailException
-
checkNonEmpty
public static <T> Collection<T> checkNonEmpty(Collection<T> value, Supplier<String> message) throws EmailException - Throws:
EmailException
-
checkNonEmpty
- Throws:
EmailException
-
checkNonEmpty
- Throws:
EmailException
-
checkNonNull
- Throws:
EmailException
-
printStackTrace
Prints the stack trace of this exception to the standard error stream.- Overrides:
printStackTracein classThrowable
-
printStackTrace
Prints the stack trace of this exception to the specified stream.- Overrides:
printStackTracein classThrowable- Parameters:
out- thePrintStreamto use for output
-
printStackTrace
Prints the stack trace of this exception to the specified writer.- Overrides:
printStackTracein classThrowable- Parameters:
out- thePrintWriterto use for output
-