Raise an exception for invalid tunnel range or malformed range.
774585
def _parse_nexus_vni_range(self, tunnel_range):
        """"""
        for ident in tunnel_range:
            if not self._is_valid_nexus_vni(ident):
                raise exc.NetworkTunnelRangeError(
                    tunnel_range=tunnel_range,
                    error=_("%(id)s is not a valid Nexus VNI value.") %
                    {'id': ident})

        if tunnel_range[1] < tunnel_range[0]:
            raise exc.NetworkTunnelRangeError(
                tunnel_range=tunnel_range,
                error=_("End of tunnel range is less than start of "
                        "tunnel range."))
880046
def raise_error(error_type: str) -> None:
    """"""
    try:
        error = next((v for k, v in ERROR_CODES.items() if k in error_type))
    except StopIteration:
        error = AirVisualError
    raise error(error_type)
205742
def _raise_exception(self, args, kwargs):
        

        error_message = (
            "Received unexpected call to '{}' on {!r}.  The supplied arguments "
            "{} do not match any available allowances."
        )

        raise UnallowedMethodCallError(
            error_message.format(
                self._method_name,
                self._target.obj,
                build_argument_repr_string(args, kwargs)
            )
        )
1320185
private static <T extends Comparable<T>> void ensureValidRange(T min, T max) {
    if (min == null) {
      throw new InvalidOperationException("Null value for minimum.");
    }
    if (max == null) {
      throw new InvalidOperationException("Null value for maximum.");
    }
    if (min.compareTo(max) >= 0) {
      throw new InvalidOperationException("Invalid range: " + min + " >= " + max);
    }
  }
827928
def raiseError(cls, message):
        
        error_message = "[error] %s" % message
        if cls.__raise_exception__:
            raise Exception(error_message)

        cls.colorprint(error_message, Fore.RED)
        sys.exit(1)
1253434
def raise_failure_exception(self, expect_or_allow='Allowed'):
        

        raise MockExpectationError(
            "{} '{}' to be called {}on {!r} with {}, but was not. ({}:{})".format(
                expect_or_allow,
                self._method_name,
                self._call_counter.error_string(),
                self._target.obj,
                self._expected_argument_string(),
                self._caller.filename,
                self._caller.lineno,
            )
        )
760975
def raise_error(
            self,
            exception_type,  # type: Type[Exception]
            message  # type: Text
    ):
        # type: (...) -> NoReturn
        """"""
        error_message = '{} at {}'.format(message, repr(self))
        raise exception_type(error_message)
1133789
@Factory
    public static Matcher<Proc> raisesException(Class<? extends Exception> clazz) {
        return new Raises(IsThrowable.exception(clazz));
    }
802955
def check_range(number, min_r, max_r, name=""):
    
    try:
        number = float(number)
        if number < min_r or number > max_r:
            raise FFmpegNormalizeError(
                "{} must be within [{},{}]".format(
                    name, min_r, max_r
                )
            )
        return number
        pass
    except Exception as e:
        raise e
306432
def _handle_azure_exception():
    
    try:
        yield

    except _AzureHttpError as exception:
        if exception.status_code in _ERROR_CODES:
            raise _ERROR_CODES[exception.status_code](str(exception))
        raise
692332
public static void invalidRangeIf(boolean tester, String msg, Object... args) {
        if (tester) {
            throw invalidRange(msg, args);
        }
    }
367289
def python_3000_raise_comma(logical_line):
    
    """
    match = RAISE_COMMA_REGEX.match(logical_line)
    if match and not RERAISE_COMMA_REGEX.match(logical_line):
        yield match.end() - 1, "W602 deprecated form of raising exception"
1252668
def raise_error(self, e, exc_info=None):
        """"""
        if not exc_info:
            exc_info = sys.exc_info()

        if not isinstance(e, InterfaceError):
            # allow python's built in errors to filter up through
            # https://docs.python.org/2/library/exceptions.html
            #if not hasattr(exceptions, e.__class__.__name__):
            if not hasattr(builtins, e.__class__.__name__):
                e = self._create_error(e, exc_info)

        reraise(e.__class__, e, exc_info[2])
382314
def gpg_error(exception, message):
    """"""
    LOGGER.debug("GPG Command %s", ' '.join([str(x) for x in exception.cmd]))
    LOGGER.debug("GPG Output %s", exception.output)
    raise CryptoritoError(message)
694033
def _log_and_raise_exception(msg, data, cls=FoursquareException):
  """"""
  data = u'{0}'.format(data)
  # We put data as a argument for log.error() so error tracking systems such
  # as Sentry will properly group errors together by msg only
  log.error(u'{0}: %s'.format(msg), data)
  raise cls(u'{0}: {1}'.format(msg, data))
1066643
def raise_(tp, value=None, tb=None):
    
    if value is not None and isinstance(tp, Exception):
        raise TypeError("instance exception may not have a separate value")
    if value is not None:
        exc = tp(value)
    else:
        exc = tp
    if exc.__traceback__ is not tb:
        raise exc.with_traceback(tb)
    raise exc
321221
def raise_exception(self, exception):
        
        self.__data = None
        self.__exception = exception
        self.__event.set()