/*
If value is RECOVERY_FAIL, we consider it as recovery failure
324951
public synchronized void put(String path, long value, String taskId) {
    Point p;
    int last = windowNum - 1;
    if (value == RECOVERY_FAIL) {
      p = new Point(value, path, System.currentTimeMillis(), taskId);
      AtomicInteger counter = failedRecoveredFiles.get(path);
      if (counter == null) {
        counter = new AtomicInteger(0);
        failedRecoveredFiles.put(path, counter);
      }
      if (counter.incrementAndGet() == 1) {
        totalFailedPaths.get(last).incrementAndGet();
      }
    } else {
      value /= dividend;
      p = new Point(value, path, System.currentTimeMillis(), taskId);
      CounterArray counters = histo.get(value);
      if (counters == null) {
        counters = new CounterArray(windowNum);
        histo.put(value, counters);
      }
      counters.incrementAndGet(last);
      totalPoints.incrementAndGet(last);
    }
    points.add(p);
    InjectionHandler.processEvent(InjectionEvent.RAID_SEND_RECOVERY_TIME, this, path, 
        value, taskId);
  }
611431
void checkRecallValidity() {
    double x0 = recall.exec(this, 0);
    for (int i = 1; i < _nBins; i++) {
      double x1 = recall.exec(this, i);
      if (x0 > x1)
        throw new H2OIllegalArgumentException(String.valueOf(i), "recall", x0 + " > " + x1);
      x0 = x1;
    }
  }
217811
boolean isFailure(ExecutionResult result) {
    return failureConditions.isEmpty() ?
        result.getFailure() != null :
        isFailure((R) result.getResult(), result.getFailure());
  }
239235
def clean_fails(self):
        
        for item in self.data:
            if item.failure and not item.retries_left > 0:
                return True
        return False
1270803
def _parse_fail(name, var_type, value, values):
  """"""
  raise ValueError(
      'Could not parse hparam \'%s\' of type \'%s\' with value \'%s\' in %s' %
      (name, var_type.__name__, value, values))
712136
public static void validateRecovery(Exception ex, CxxLanguage language) {
    Optional<Boolean> recovery = language.IsRecoveryEnabled();
    if (recovery.isPresent() && recovery.get()) {
      return;
    }
    LOG.info("Recovery is disabled, failing analysis : '{}'", ex.toString());
    throw new IllegalStateException(ex.getMessage(), ex.getCause());
  }
888271
function failed(err) {
    leverage.emit(channel +'::error', err);

    if (!bailout) return debug('received an error without bailout mode, gnoring it', err.message);

    leverage.emit(channel +'::bailout', err);
    leverage.unsubscribe(channel);
  }
87161
private static void checkNoConflictInValueBucket(
      Object value, Entry<?, ?> entry, @Nullable ImmutableMapEntry<?, ?> valueBucketHead) {
    for (; valueBucketHead != null; valueBucketHead = valueBucketHead.getNextInValueBucket()) {
      checkNoConflict(!value.equals(valueBucketHead.getValue()), "value", entry, valueBucketHead);
    }
  }
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
  }
939314
def _IsRetryable(error):
  """"""
  if not isinstance(error, MySQLdb.OperationalError):
    return False
  if not error.args:
    return False
  code = error.args[0]
  return code in _RETRYABLE_ERRORS
922367
def error_retry_codes(self, value):
        """"""
        if isinstance(value, six.string_types):
            value = [int(x) for x in value.split(",")]
        self._set_option("error_retry_codes", value)
202137
function (successValue, failValue, fns) {
            for (var i = 0; i < fns.length; i++) {
                var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);
                if (o === failValue) {
                    return o;
                }
            }
            return successValue;
        }
712191
private int healthCheckFailed() {
        int oldState, newState;
        for (;;) {
            oldState = this.state;
            if ((oldState & ERROR) != ERROR) {
                newState = oldState | ERROR;
                UndertowLogger.ROOT_LOGGER.nodeIsInError(jvmRoute);
            } else if ((oldState & ERROR_MASK) == ERROR_MASK) {
                return ERROR_MASK;
            } else {
                newState = oldState +1;
            }
            if (stateUpdater.compareAndSet(this, oldState, newState)) {
                return newState & ERROR_MASK;
            }
        }
    }
648230
function onEntityDeletionFailed( serverResponse ) {
			self.logInterface.error( serverResponse.data );
			self.scope.$emit( "absyncError", serverResponse );

			if( self.throwFailures ) {
				throw serverResponse;
			}
		}
709046
@SuppressWarnings("unchecked")
  public RetryPolicy<R> abortOn(Class<? extends Throwable>... failures) {
    Assert.notNull(failures, "failures");
    Assert.isTrue(failures.length > 0, "Failures cannot be empty");
    return abortOn(Arrays.asList(failures));
  }
388782
private void captureFailure(AssertionError captured) {
    if (failure != null) {
      // TODO(diamondm) is it worthwhile to add the failures as suppressed exceptions?
      throw new AssertionError(
          lenientFormat(
              "ExpectFailure.whenTesting() caught multiple failures:\n\n%s\n\n%s\n",
              Platform.getStackTraceAsString(failure), Platform.getStackTraceAsString(captured)));
    }
    failure = captured;
  }
402333
private void checkForError(JsonNode resp) throws WePayException
	{
		JsonNode errorNode = resp.get("error");
		if (errorNode != null)
			throw new WePayException(errorNode.asText(), resp.path("error_description").asText(), resp.path("error_code").asInt());
	}