The difference beween setCompleteValue()/setErrorValue() and complete()/error() is that setXXXValue() moves a promise directly to the success/error state without starting another notification pass (because one is already ongoing).
768258
function setErrorInfo(promise, errorId, isException) {
        promise._isException = isException || false;
        promise._errorId = errorId;
    }
505598
function done(error) {
    if (error) {
      errors.push(error);
    }
    if (--initializing <= 0) {
      if (errors && errors.length) {
        var errorResult = new Error('Errors occurred during initialization.');
        errorResult.initializationErrors = errors;
        callback(errorResult);
      } else {
        processPostInitializeQueue(postInitializeQueue, callback);
      }
    }
  }
453231
protected final <V> void error(Throwable t, SettableFuture<V> future) {
    state.set(State.ERROR);
    if (future != null) {
      future.setException(t);
    }
    caller.error(t);
  }
830293
function(err, objs) {
        that.worker = null;
        if(err) {
          that.setError(err);
          that.setStatus("Error.");
          that.state = 3; // incomplete
        } else {
          that.setCurrentObjects(objs);
          that.setStatus("Ready.");
          that.state = 2; // complete
        }
        that.enableItems();
      }
164640
@Override
   public boolean complete(T value) {
      cancelTimeoutTask();
      repository.removeRequest(requestId);
      return super.complete(value);
   }
298586
function(error, params) {
      if (error) {
        log.error('_sync.onComplete', t.className, error);
        options.error(null, error);
      } else {
        log.info('_sync.onComplete', t.className, model.get('id'));
        options.success(params);
      }
    }
988773
public void onComplete(String response, boolean error, String errorMessage,
            final String stackTrace, String statusCode, int statusCodeInt) {
        cancelCancellable();
        reply(response, error, errorMessage, stackTrace, statusCode,
                statusCodeInt);
    }
1047455
function Rejected(x) {
			Promise.createContext(this);

			this.id = ++errorId;
			this.value = x;
			this.handled = false;
			this.reported = false;

			this._report();
		}
531147
function _initComplete(err) {
          if( !isResolved ) {
            isResolved = true;
            if( err ) { def.reject(err); }
            else { def.resolve(firebaseObject); }
          }
        }
958617
private int setExceptionalCompletion(Throwable ex) {
        int s = recordExceptionalCompletion(ex);
        if ((s & DONE_MASK) == EXCEPTIONAL)
            internalPropagateException(ex);
        return s;
    }
304010
public synchronized void fail (Throwable error) {
    if (pixelWidth == 0) pixelWidth = 50;
    if (pixelHeight == 0) pixelHeight = 50;
    setBitmap(createErrorBitmap(pixelWidth, pixelHeight));
    ((RPromise<Image>)state).fail(error); // state is a deferred promise
  }
350259
public synchronized void setComplete(boolean completed) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setComplete", completed);
        this.completed = completed;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setComplete");
    }
124282
protected <T extends OperationResponse> void completeOperation(ServerStateMachine.Result result, OperationResponse.Builder<?, T> builder, Throwable error, CompletableFuture<T> future) {
    if (isOpen()) {
      if (result != null) {
        builder.withIndex(result.index);
        builder.withEventIndex(result.eventIndex);
        if (result.result instanceof Exception) {
          error = (Exception) result.result;
        }
      }

      if (error == null) {
        future.complete(builder.withStatus(Response.Status.OK)
          .withResult(result != null ? result.result : null)
          .build());
      } else if (error instanceof CompletionException && error.getCause() instanceof CopycatException) {
        future.complete(builder.withStatus(Response.Status.ERROR)
          .withError(((CopycatException) error.getCause()).getType())
          .build());
      } else if (error instanceof CopycatException) {
        future.complete(builder.withStatus(Response.Status.ERROR)
          .withError(((CopycatException) error).getType())
          .build());
      } else {
        LOGGER.warn("An unexpected error occurred: {}", error);
        future.complete(builder.withStatus(Response.Status.ERROR)
          .withError(CopycatError.Type.INTERNAL_ERROR)
          .build());
      }
    }
  }
223531
function done(error) {
      global.clearTimeout(timer);
      eventLoop.removeListener('tick', ontick);
      eventLoop.removeListener('idle', done);
      eventLoop.browser.removeListener('error', done);

      --eventLoop.waiting;
      try {
        callback(error);
      } catch (error) {
        // If callback makes an assertion that fails, we end here.
        // If we throw error synchronously, it gets swallowed.
        setImmediate(function() {
          throw error;
        });
      }
    }
1204552
function(err, data, response) {

				// call the 'response' callback, if provided using 'node' style callback pattern
				if (options.complete) {
					options.complete.call(model, err, data, response, options);
				}

				// trigger any event listeners for "complete"
				model.trigger('complete', err, data, response, options);
			}
384580
private int setCompletion(int completion) {
        for (int s;;) {
            if ((s = status) < 0)
                return s;
            if (U.compareAndSwapInt(this, STATUS, s, s | completion)) {
                if ((s >>> 16) != 0)
                    synchronized (this) { notifyAll(); }
                return completion;
            }
        }
    }
505259
function handleError(promise) {
      if (canHandleError) {
        return promise.catch(function(err) {
          if (ctx) {
            ctx.error = err;
            if (ctx.emit) ctx.emit('error', ctx);
          } else {
            ctx = { error: err };
          }
          return onError(ctx, next).catch(function(err) {
            // Log catched error in onError
            logError(`[${new Date()}] ${err.name || err.message} \n ${err.stack}`);
          });
        });
      } else {
        return promise;
      }
    }