code: private Part createErrorPart(Attachment a) {
          return Part.builder().setName(String.valueOf(a.hashCode())).setSize(0).setType(Attachment.LOCAL_PART_TYPE_ERROR).setUrl(null).setData(a.getError().getLocalizedMessage()).build();
      }
docs: Create message part based on attachment upload error details.
  
  @return Message part.