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 newEmailException
with no detail message.EmailException
(String msg) Constructs a newEmailException
with specified detail message.EmailException
(String msg, Throwable rootCause) Constructs a newEmailException
with specified detail message and nestedThrowable
root cause.EmailException
(Throwable rootCause) Constructs a newEmailException
with specified nestedThrowable
root cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> V
static <T> T
static String
checkNonEmpty
(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> T
checkNonNull
(T test, Supplier<String> message) void
Prints the stack trace of this exception to the standard error stream.void
Prints the stack trace of this exception to the specified stream.void
Prints 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 newEmailException
with no detail message. -
EmailException
Constructs a newEmailException
with specified detail message.- Parameters:
msg
- the error message.
-
EmailException
Constructs a newEmailException
with specified detail message and nestedThrowable
root cause.- Parameters:
msg
- the error message.rootCause
- the exception or error that caused this exception to be thrown.
-
EmailException
Constructs a newEmailException
with specified nestedThrowable
root 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:
printStackTrace
in classThrowable
-
printStackTrace
Prints the stack trace of this exception to the specified stream.- Overrides:
printStackTrace
in classThrowable
- Parameters:
out
- thePrintStream
to use for output
-
printStackTrace
Prints the stack trace of this exception to the specified writer.- Overrides:
printStackTrace
in classThrowable
- Parameters:
out
- thePrintWriter
to use for output
-