public class DefaultMailErrorHandler extends java.lang.Object implements MailErrorHandler
MailErrorHandler
implementation simply rethrows the exception it
receives.Constructor and Description |
---|
DefaultMailErrorHandler() |
Modifier and Type | Method and Description |
---|---|
void |
handle(org.springframework.mail.MailMessage message,
java.lang.Exception exception)
Wraps the input exception with a runtime
MailException . |
void |
setMaxMessageLength(int maxMessageLength)
The limit for the size of message that will be copied to the exception
message.
|
public void setMaxMessageLength(int maxMessageLength)
maxMessageLength
- the maximum message lengthpublic void handle(org.springframework.mail.MailMessage message, java.lang.Exception exception) throws org.springframework.mail.MailException
MailException
. The
exception message will contain the failed message (using toString).handle
in interface MailErrorHandler
message
- a failed messageexception
- a MessagingExceptionorg.springframework.mail.MailException
- a translation of the ExceptionMailErrorHandler.handle(MailMessage, Exception)