Indicate that result is an Error, to set appropriate results.

@param moreResultAvailable indicate if other results (ResultSet or updateCount) are available.
343530
public void addStatsError(boolean moreResultAvailable) {
    if (cmdInformation == null) {
      if (batch) {
        cmdInformation = new CmdInformationBatch(expectedSize, autoIncrement);
      } else if (moreResultAvailable) {
        cmdInformation = new CmdInformationMultiple(expectedSize, autoIncrement);
      } else {
        cmdInformation = new CmdInformationSingle(0, Statement.EXECUTE_FAILED, autoIncrement);
        return;
      }
    }
    cmdInformation.addErrorStat();
  }
1358262
def set_result(self, result):
        """"""

        if self.is_finished():
            raise InternalError("set_result called on finished AsynchronousResponse",
                                result=self._result, exception=self._exception)

        self._result = result
        self.finish()
1057863
public void fail(Throwable t) {
    if (!failed) {
      if (doneHandler != null) {
        doneHandler.handle(new DefaultFutureResult<T>(t));
      } else {
        cause = t;
      }
      failed = true;
    }
  }
41359
public void setSuccess(V result) {
        if (this.isCancelled()) {
            this.releaseIfNeed(result);
        }
        if (setSuccess0(result)) {
            notifyListeners();
            return;
        }
        throw new IllegalStateException("complete already: " + this);
    }
1007263
def set_exception(self, exception):
        """"""
        self._exception = exception
        self._result_set = True
        self._invoke_callbacks(self)
1187785
@Override
    public void onFailure(Throwable t) {
        if (cancelled) {
            return;
        }

        t = adjustThrowable(t);
        if (handleInternalException(t)) {
            next();
        } else {
            cancel();
        }
    }
355721
public void getResult (ResultListener<T> rl)
    {
        if (_error != null) {
            rl.requestFailed(_error);
        } else if (_list == null) { // _list == null when we have a result
            rl.requestCompleted(_result);
        } else {
            _list.add(rl);
        }
    }
734634
public void setResult(Result result) throws IllegalArgumentException {
		Check.notNull(result);
		if(result instanceof SAXResult) {
			setTarget((SAXResult)result);
		} else {
			 th = saxHelper.newIdentity();
			th.setResult(result);
			setTarget(new SAXResult(th));
		}
	}
1161553
public function setResult($result = self::RESULT_SUCCESS,
                              $message = null,
                              array $data = [],
                              array $additional = [])
    {
        $this->headers->set('X-Phlexible-Response', 'result');

        $values = [
            'success' => $result,
            'msg' => $message,
            'data' => $data,
        ];

        if (is_array($additional) && count($additional)) {
            foreach ($additional as $key => $value) {
                $values += $additional;
            }
        }

        $this->setData($values);
    }
940558
protected void reportError(ValidationResult result, String messageKey, 
			Object... params) {
		reportMessage(result, Severity.ERROR, messageKey, params);		
	}
593738
public synchronized void setSuccess(Res paramResult) {
        if (done)
            return; // can't mark done twice
        result = paramResult;
        done = true;
        notifyAll();

        // if we have a callback to call, schedule
        // it on a different thread. Who knows what this
        // thread is doing.
        if (callback != null) {
            QueueBuffer.executor.submit(new Callable<Void>() {
                public Void call() throws Exception {
                    callback.onSuccess(result);
                    return null;
                }
            });

        }
    }
982504
public boolean setException(TBase<?, ?> result, Throwable cause) {
        final Class<?> causeType = cause.getClass();
        for (Entry<Class<Throwable>, TFieldIdEnum> e : exceptionFields.entrySet()) {
            if (e.getKey().isAssignableFrom(causeType)) {
                ThriftFieldAccess.set(result, e.getValue(), cause);
                return true;
            }
        }
        return false;
    }
933688
def set_result(self, result):
        """"""
        result = result.result()[0]
        if self.future is not None:
            if isinstance(result, Exception):
                self.future.set_exception(result)
            else:
                self.future.set_result(result)
            self.future = None
        elif isinstance(result, Exception):
            raise result
912755
function errorOrResult(error, result, fn) {
        return error ? fn(error) : fn(null, result);
    }
1242500
public function checkResult(Exception\JavaException $result): void
    {
        if (PjbProxyClient::getInstance()->getOption('java_prefer_values') || ($result->__hasDeclaredExceptions === 'T')) {
            throw $result;
        } else {
            $msg = 'Unchecked exception detected: '.HelperFunctions::java_truncate($result->__toString());
            // Log error
            $this->client->getLogger()->critical("[soluble-japha] $msg (".__METHOD__.')');
            trigger_error($msg, E_USER_WARNING);
        }
    }
1369284
@Override
  public void onException(Throwable failureCause) {
    Preconditions.checkNotNull(failureCause, "failureCause");
    Status status = Status.UNAVAILABLE.withCause(failureCause);
    startGoAway(0, ErrorCode.INTERNAL_ERROR, status);
  }
875769
public void incrementExceptionCount(Throwable throwable) {

        if (throwable instanceof ServiceUnavailableException) {
            serviceUnavailableExceptionCounter.incrementAndGet();
        } else if (containsThrowableOfType(throwable, communicationExceptionsTypes)) {
            communicationExceptionCounter.incrementAndGet();
        } else if (containsThrowableOfType(throwable, businessExceptionsTypes)) {
            businessExceptionCounter.incrementAndGet();
        } else {
            otherExceptionCounter.incrementAndGet();
        }
    }