public static Attachment writeAttachmentWithErrorMessage ( Throwable throwable , String title ) { String message = throwable . getMessage ( ) ; try { return writeAttachment ( message . getBytes ( CONFIG . getAttachmentsEncoding ( ) ) , title ) ; } catch ( Exception e ) { e . addSuppressed ( throwable ) ; LOGGER . error ( String . format ( "Can't write attachment \"%s\"" , title ) , e ) ; } return new Attachment ( ) ; }
Write throwable as attachment .