code: 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();
      }
docs: Write throwable as attachment.
  
  @param throwable to write
  @param title     title of attachment
  @return Created {@link ru.yandex.qatools.allure.model.Attachment}