code: static EntityManagerException wrap(DatastoreException exp) {
      switch (exp.getCode()) {
        case ERROR_CODE_ENTITY_NOT_FOUND:
          return new EntityNotFoundException(exp);
        case ERROR_CODE_ENTITY_ALREADY_EXISTS:
          return new EntityAlreadyExistsException(exp);
        default:
          return new EntityManagerException(exp);
  
      }
    }
docs: Wraps the given DatastoreException into an {@link EntityManagerException} or a subclass of
  {@link EntityManagerException}.
  
  @param exp
  the DatastoreException
  @return An {@link EntityManagerException} or a subclass of {@link EntityManagerException}.