docs: public static Attachment writeAttachmentSafely(byte[] attachment, String title, String type) {
          try {
              return type == null || type.isEmpty()
                      ? writeAttachment(attachment, title)
                      : writeAttachment(attachment, title, type);
  
          } catch (Exception e) {
              LOGGER.trace("Error while saving attachment " + title + ":" + type, e);
              return writeAttachmentWithErrorMessage(e, title);
          }
      }