code: func (e *engineImpl) getInvocation(c context.Context, jobID string, invID int64) (*Invocation, error) {
  	inv := &Invocation{ID: invID}
  	switch err := ds.Get(c, inv); {
  	case err == nil:
  		if inv.JobID != jobID {
  			logging.Errorf(c,
  				"Invocation %d is associated with job %q, not %q. Treating it as missing.",
  				invID, inv.JobID, jobID)
  			return nil, ErrNoSuchInvocation
  		}
  		return inv, nil
  	case err == ds.ErrNoSuchEntity:
  		return nil, ErrNoSuchInvocation
  	default:
  		return nil, transient.Tag.Apply(err)
  	}
  }
docs: ////////////////////////////////////////////////////////////////////////////////
  // Invocations related methods.
  // getInvocation returns an existing invocation or ErrNoSuchInvocation error.
  //
  // Double checks that the invocation belongs to the given job. Returns
  // ErrNoSuchInvocation if not.