Report a failure by setting some attributes that our caller will query, then updating our Deferrable
 disposition so our caller gets notified via errback.
161831
def report_failure(title, message, exception = nil)
      if exception
        Log.error("ExternalParameterGatherer failed due to " +
                  "#{exception.class.name}: #{exception.message} (#{exception.backtrace.first})")
      end

      @failure_title   = title
      @failure_message = message
      EM.next_tick { fail }
    end
322035
public void reportFailure(String importerName, String procName, boolean decrementPending) {
        StatsInfo statsInfo = getStatsInfo(importerName, procName);
        if (decrementPending) {
            statsInfo.m_pendingCount.decrementAndGet();
        }
        statsInfo.m_failureCount.incrementAndGet();
    }
1296746
public void failure(Throwable failure) {
        try {
            lock.lock();
            this.failure = failure;
            notifyHaveResult();
        }
        finally {
            lock.unlock();
        }
    }
573373
def _on_report_error(self, code, message, connection_id):
        """"""
        self._logger.critical(
            "Error receiving reports, no more reports will be processed on this adapter, code=%d, msg=%s", code, message
        )
539469
function onFailure(err) {
          onTimelyResponse(spec.code);

          logError(`Server call for ${spec.code} failed: ${err}. Continuing without bids.`);
          onResponse();
        }
283772
def process_failure(result) #:nodoc:
      if @failure_callback
        @failure_callback.call(message, result)
      else
        failure(result)
      end
    rescue Exception
      Beetle::reraise_expectation_errors!
    end
197001
protected void handleInstallRequestFailure(MemberState member, InstallRequest request, Throwable error) {
    // Log the failed attempt to contact the member.
    failAttempt(member, error);
  }
1336321
protected void handleConfigureResponseFailure(MemberState member, ConfigureRequest request, Throwable error) {
    // Log the failed attempt to contact the member.
    failAttempt(member, error);
  }
1067567
def on_failure(self, exc, task_id, args, kwargs, einfo):
        
        log.error('[{}] failed due to {}'.format(task_id, getattr(einfo, 'traceback', None)))
        super(LoggedTask, self).on_failure(exc, task_id, args, kwargs, einfo)
1147061
@Override
  public FutureResultImpl<T> setFailure(Throwable throwable) {
    this.throwable = throwable;
    failed = true;
    checkCallHandler();
    return this;
  }
370722
protected void notifyFailure (int oid, String message)
    {
        // let the penders know that the object is not available
        PendingRequest<?> req = _penders.remove(oid);
        if (req == null) {
            log.warning("Failed to get object, but no one cares?!", "oid", oid);
            return;
        }

        for (int ii = 0; ii < req.targets.size(); ii++) {
            req.targets.get(ii).requestFailed(oid, new ObjectAccessException(message));
        }
    }
1236065
def describe_error(failure):
    """"""
    if failure.check(ResponseFailed):
        if any(f.check(InfiniteRedirection)
               for f in failure.value.reasons):
            return u'Encountered too many redirects.'
        return u'Received incomplete response from server.'
    if failure.check(ConnectError, DNSLookupError, BlacklistedHost):
        return u'Could not connect to server.'
    return failure
1187785
@Override
    public void onFailure(Throwable t) {
        if (cancelled) {
            return;
        }

        t = adjustThrowable(t);
        if (handleInternalException(t)) {
            next();
        } else {
            cancel();
        }
    }
95921
public void onFailure (Throwable cause)
    {
        _panel.clear();
        _panel.add(Widgets.newLabel(formatError(cause), "errorLabel"));
        Console.log("Service request failed", cause);
    }
754427
def on_failure(self, exc, task_id, args, kwargs, einfo):
        
        if not FailedTask.objects.filter(task_id=task_id, datetime_resolved=None).exists():
            FailedTask.objects.create(
                task_name=_truncate_to_field(FailedTask, 'task_name', self.name),
                task_id=task_id,  # Fixed length UUID: No need to truncate
                args=args,
                kwargs=kwargs,
                exc=_truncate_to_field(FailedTask, 'exc', repr(exc)),
            )
        super(PersistOnFailureTask, self).on_failure(exc, task_id, args, kwargs, einfo)
40721
private void handleRequestFailure(long requestId, Throwable error, ThreadContext context) {
    ByteBuf buffer = channel.alloc().buffer(10)
      .writeByte(RESPONSE)
      .writeLong(requestId)
      .writeByte(FAILURE);

    try {
      writeError(buffer, error, context);
    } catch (SerializationException e) {
      return;
    }

    channel.writeAndFlush(buffer, channel.voidPromise());
  }
932506
def _handle_commit_error(self, failure, retry_delay, attempt):
        
        # Check if we are stopping and the request was cancelled
        if self._stopping and failure.check(CancelledError):
            # Not really an error
            return self._deliver_commit_result(self._last_committed_offset)

        # Check that the failure type is a Kafka error...this could maybe be
        # a tighter check to determine whether a retry will succeed...
        if not failure.check(KafkaError):
            log.error("Unhandleable failure during commit attempt: %r\n\t%r",
                      failure, failure.getBriefTraceback())
            return self._deliver_commit_result(failure)

        # Do we need to abort?
        if (self.request_retry_max_attempts != 0 and
                attempt >= self.request_retry_max_attempts):
            log.debug("%r: Exhausted attempts: %d to commit offset: %r",
                      self, self.request_retry_max_attempts, failure)
            return self._deliver_commit_result(failure)

        # Check the retry_delay to see if we should log at the higher level
        # Using attempts % 2 gets us 1-warn/minute with defaults timings
        if retry_delay < self.retry_max_delay or 0 == (attempt % 2):
            log.debug("%r: Failure committing offset to kafka: %r", self,
                      failure)
        else:
            # We've retried until we hit the max delay, log alternately at warn
            log.warning("%r: Still failing committing offset to kafka: %r",
                        self, failure)

        # Schedule a delayed call to retry the commit
        retry_delay = min(retry_delay * REQUEST_RETRY_FACTOR,
                          self.retry_max_delay)
        self._commit_call = self.client.reactor.callLater(
            retry_delay, self._send_commit_request, retry_delay, attempt + 1)