Sets an error and status as completed. Notifies all callbacks.
328827
protected void error(E error) {
    this.error = checkNotNull(error);
    this.completed = true;
    for (Callback<T, E> callback : toBeNotified) {
      callback.error(error);
    }
  }
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;
        });
      }
    }
1320088
def raise_for_status(self):
        """"""
        if 400 <= self.status_code < 600:
            message = 'Error %s for %s' % (self.status_code, self.url)
            raise HTTPError(message)
34862
def notify_complete(self, result_code, error_info):
        
        if not isinstance(result_code, baseinteger):
            raise TypeError("result_code can only be an instance of type baseinteger")
        if not isinstance(error_info, IVirtualBoxErrorInfo):
            raise TypeError("error_info can only be an instance of type IVirtualBoxErrorInfo")
        self._call("notifyComplete",
                     in_p=[result_code, error_info])
1040404
def _set_status(self, status, ex=None):
        '''  '''
        self._status = status
        logger.debug("Set status(%s) for %s" % (self._status, self.session_id))
        self.set_done()
        if ex:
            self._exception = ex
1035896
function done(err) {
            if (err != null) {
                process.exitCode = 1
                console.error(`  ERROR: ${err.message}`)
            }
            if (options.verbose && err == null) {
                console.log("  Done.")
            }

            next()

            if (callback != null) {
                callback(err)
            }
        }
4988
def on_success(self, fn, *args, **kwargs):
        

        self._callbacks.append((fn, args, kwargs))

        result = self._resulted_in
        if result is not _NOTHING_YET:
            self._succeed(result=result)
903782
def on_finished(self):
        """"""
        self.controller.is_running = False

        error = self.controller.current_error
        if error is not None:
            self.info(self.tr("Stopped due to error(s), see Terminal."))
        else:
            self.info(self.tr("Finished successfully!"))
773854
void setError(Exception error) {
    if (this.error != null) {
      throw new IllegalStateException(
          "Cannot reassign the error value of a response!");
    }
    this.error = error;
    this.complete = true;
    try {
      this.states.put(RESPONSE_COMPLETE);
    } catch (InterruptedException e) {
      log.error("Interrupted trying to indicate an error condition.", e);
    }
  }
553308
public function onFailure()
    {
        if ($this->onConnected) {
            $this->onConnected->executeAll($this);
            $this->onConnected = null;
        }
    }
1024926
private void errorStatus(MtasSolrStatus status, IOException exception) {
		try {
			status.setError(exception);
			if (requestHandler != null) {
				requestHandler.finishStatus(status);
			}
		} catch (IOException e) {
			log.error(e);
		}
	}
677733
function complete ( err, msg ){
      b9.off('hello', success ); // cleanup
      // optional callback, error-first...
      if ( typeof callback == 'function' ){
        callback( err, msg );
      }
    }
712686
def register_status_callback(self, callback, switch):
        """"""
        if self.status_callbacks.get(switch, None) is None:
            self.status_callbacks[switch] = []
        self.status_callbacks[switch].append(callback)
456296
function finished(err) {
    if (err) self.critical('Failed to store %s. %s.', base, err.message);
    if (fn) fn(err, collection);
  }
675460
def on_finish(self, func):
        '''
        '''
        if self._done.is_set():
            if self._failure is None:
                backend.schedule(func, args=(self._value,))
        else:
            self._cbacks.append(func)
440282
function(err, result) {
      if (err && !util.isError(err)) {
        err = new Error(err);
      }
      if (callback) callback(err, result);
    }
547676
def notify_batches_finished(self, statuses):
        
        with self._wait_condition:
            self._statuses = statuses
            self._wait_condition.notify()