throws MessagingException {
if (logger.isDebugEnabled()) {
logger.debug("Message contains attachments. Ignoring payload and trying to generate multipart response.");
}
final MultipartHttpEntity multipartEntity;
<BUG>try {
multipartEntity = new MultipartHttpEntity(HttpPartDataSource.createFrom(parts));
</BUG>
return new ByteArrayHttpEntity(HttpMultipartEncoder.createMultipartContent(multipartEntity, contentType));
} catch (Exception e) {

throws MessagingException {
if (logger.isDebugEnabled()) {
logger.debug("Message contains attachments. Ignoring payload and trying to generate multipart response.");
}
final MultipartHttpEntity multipartEntity;
try {
Transformer objectToByteArray = muleContext.getRegistry().lookupTransformer(OBJECT, BYTE_ARRAY);
multipartEntity = new MultipartHttpEntity(HttpPartDataSource.createFrom(partPayload, objectToByteArray));
return new ByteArrayHttpEntity(HttpMultipartEncoder.createMultipartContent(multipartEntity, contentType));
} catch (Exception e) {
