Only errors that are NOT instanceOf the specified types will trigger a retry
760354
@SafeVarargs
  public static RetryBuilder allBut(Class<? extends Throwable>... types) {
    RetryBuilder retryBuilder = new RetryBuilder();
    retryBuilder.maxAttempts = 1;

    retryBuilder.errorsStoppingRetry = Arrays.asList(types);
    retryBuilder.inverse = false;

    return retryBuilder;
  }
294818
function handleRequestError(eventTarget, type) {
  readyStateChange(eventTarget, states.DONE);

  dispatchProgressEvent(eventTarget, {
    type: 'progress',
    total: 0,
    loaded: 0,
    lengthComputable: false
  });

  dispatchProgressEvent(eventTarget, {
    type: type,
    total: 0,
    loaded: 0,
    lengthComputable: false
  });

  dispatchProgressEvent(eventTarget, {
    type: 'loadend',
    total: 0,
    loaded: 0,
    lengthComputable: false
  });
}
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
434111
function createError(code, type, desc) {
	errors[code] = function (msg, meta) {
		const err = new type(msg);

		if (desc) {
			if (!meta) {
				meta = {};
			}
			meta.desc = desc;
		}

		return Object.defineProperties(err, {
			code: {
				configurable: true,
				enumerable: true,
				writable: true,
				value: `ERR_${code}`
			},
			meta: {
				configurable: true,
				value: meta || undefined,
				writable: true
			}
		});
	};

	Object.defineProperties(errors[code], {
		name: {
			configurable: true,
			value: code,
			writable: true
		},
		toString: {
			configurable: true,
			value: function toString() {
				return `ERR_${code}`;
			},
			writable: true
		}
	});
}
247181
private void handleGenericHNIError(Throwable t, HttpInboundServiceContextImpl hisc) {
        hisc.setHeadersParsed();
        sendErrorMessage(t);
        setPartiallyParsed(false);
    }
859202
function _onError(error) {
        if (_connectDeferred) {
            _connectDeferred.reject();
            _connectDeferred = null;
        }
        exports.trigger("error", error);
    }
789398
public <R> Try<R,Throwable> retry(final Function<? super T, ? extends R> fn) {
        return retry(fn, 7, 2, TimeUnit.SECONDS);
    }
989912
def error_handler(f):
    """"""
    @wraps(f)
    def inner(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        except NoResultFound:
            abort(404)
        except IntegrityError:
            abort(500)
    return inner
656525
def try_and_error(*funcs):
    """"""
    def validate(value):
        exc = None
        for func in funcs:
            try:
                return func(value)
            except (ValueError, TypeError) as e:
                exc = e
        raise exc
    return validate
917323
private static <E extends Throwable> E wrapIfNecessary(Throwable throwable)
			throws RetryException {
		if (throwable instanceof Error) {
			throw (Error) throwable;
		}
		else if (throwable instanceof Exception) {
			@SuppressWarnings("unchecked")
			E rethrow = (E) throwable;
			return rethrow;
		}
		else {
			throw new RetryException("Exception in retry", throwable);
		}
	}
1023274
function serializeError(err) {
  var o = {};

  Object.getOwnPropertyNames(err).forEach(function (k) {
    o[k] = err[k];
  });

  return _.omit(o, ['stack', 'type', 'arguments']);
}
215910
function onError(err) {
    if (!retries.length) return reject(err);
    setTimeout(()=>fn().then(resolve, onError), retries.shift());
  }
608627
def retry(func, exception_type, quit_event):
    
    while True:
        if quit_event.is_set():
            raise StopIteration
        try:
            return func()
        except exception_type:
            pass
314637
function retryOrError(){ 
					if (bRetrying)
						throw Error("unit hash verification failed, unit: "+unit+", objUnit: "+JSON.stringify(objUnit));
					console.log("unit hash verification failed, will retry");
					return setTimeout(function(){
						readJointDirectly(conn, unit, callbacks, true);
					}, 60*1000);
				}
239941
def raise_type_error(key, type)
      raise_error(type: "type", key: key, supposed: type, found: key.class)
    end
122677
def erred():
        
        exc_type, exc, tb = sys.exc_info()
        if issubclass(exc_type, socket.timeout):
            raise TimedOut
        elif issubclass(exc_type, requests.ConnectionError):
            internal_exc = exc.args[0]
            if isinstance(internal_exc, ReadTimeoutError):
                raise TimedOut
            else:
                raise ConnectionError(exc)
        elif issubclass(exc_type, requests.RequestException):
            raise EtcException(exc)
        reraise(exc_type, exc, tb)
2267
public static <T> T retry(final Callable<T> f, Predicate<Throwable> shouldRetry, final int maxTries) throws Exception
  {
    return retry(f, shouldRetry, 0, maxTries);
  }