Class DefaultMailErrorHandler
java.lang.Object
org.springframework.batch.item.mail.DefaultMailErrorHandler
- All Implemented Interfaces:
MailErrorHandler
This
MailErrorHandler implementation simply rethrows the exception it receives.- Since:
- 2.1
- Author:
- Dan Garrette, Dave Syer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidWraps the input exception with a runtimeMailException.voidsetMaxMessageLength(int maxMessageLength) The limit for the size of message that will be copied to the exception message.
-
Constructor Details
-
DefaultMailErrorHandler
public DefaultMailErrorHandler()
-
-
Method Details
-
setMaxMessageLength
public void setMaxMessageLength(int maxMessageLength) The limit for the size of message that will be copied to the exception message. Output will be truncated beyond that. Default value is 1024.- Parameters:
maxMessageLength- the maximum message length
-
handle
public void handle(org.springframework.mail.MailMessage message, Exception exception) throws org.springframework.mail.MailException Wraps the input exception with a runtimeMailException. The exception message will contain the failed message (using toString).- Specified by:
handlein interfaceMailErrorHandler- Parameters:
message- a failed messageexception- a MessagingException- Throws:
org.springframework.mail.MailException- a translation of the Exception- See Also:
-