An alternative constructor which raises the given error
556832
def raises(cls, sender, attrname, error, args=ANYTHING, kwargs=ANYTHING):
        ""
        def raise_error():
            raise error
        return cls(sender, attrname, returns=Invoke(raise_error), args=ANYTHING, kwargs=ANYTHING)
1056272
function makeError(constructor, super_) {
  if (super_ == null || super_ === Error) {
    super_ = BaseError;
  } else if (typeof super_ !== "function") {
    throw new TypeError("super_ should be a function");
  }

  var name;
  if (typeof constructor === "string") {
    name = constructor;
    constructor =
      construct !== undefined
        ? function() {
            return construct(super_, arguments, this.constructor);
          }
        : function() {
            super_.apply(this, arguments);
          };

    // If the name can be set, do it once and for all.
    if (setFunctionName !== undefined) {
      setFunctionName(constructor, name);
      name = undefined;
    }
  } else if (typeof constructor !== "function") {
    throw new TypeError("constructor should be either a string or a function");
  }

  // Also register the super constructor also as `constructor.super_` just
  // like Node's `util.inherits()`.
  constructor.super_ = constructor["super"] = super_;

  var properties = {
    constructor: {
      configurable: true,
      value: constructor,
      writable: true,
    },
  };

  // If the name could not be set on the constructor, set it on the
  // prototype.
  if (name !== undefined) {
    properties.name = {
      configurable: true,
      value: name,
      writable: true,
    };
  }
  constructor.prototype = Object.create(super_.prototype, properties);

  return constructor;
}
239941
def raise_type_error(key, type)
      raise_error(type: "type", key: key, supposed: type, found: key.class)
    end
645606
function error () {
  if (mocking) {
    cli.stderr += stripAnsi(concatArguments(arguments) + '\n')
  } else {
    console.error.apply(null, arguments)
  }
}
891792
def raise_error
      klass = case @response.to_s
        when "RestClient::BadRequest" then TodaysPlan::BadRequestError
        when "RestClient::Unauthorized" then  TodaysPlan::UnauthorizedError
        when "RestClient::NotFound" then TodaysPlan::NotFoundError
        else
          TodaysPlan::ServerError
        end
      raise klass.new(body['code'], body['message'], body['resolve'])
    end
689055
def error_handling(cls, fn):
        """"""
        def wrapper(*args, **kwargs):
            try:
                result = fn(*args, **kwargs)
                return result
            except InvalidRequestError as e:
                write_exception(e)

                if hasattr(e, 'request'):
                    write_error_message('request {0}'.format(repr(e.request)))
                if hasattr(e, 'response'):
                    write_error_message('response {0}'.format(repr(e.response)))

                raise e
        return wrapper
1245758
function extendError(pError, error) {
		if (error && (typeof error === 'object')) {
			['name', 'errno'].forEach(function(property) {
				if (property in error) {
					this[property]	= error[property];
				}
			}, pError);
		}

		return pError;
	}
581424
function constructor(options, error, name) {
    Pagelet.prototype.constructor.call(this, options);

    if (name) this.name = name;
    this.data = error instanceof Error ? error : {};
  }
100851
function WrapperError(message, innerError) {
  // supports instantiating the object without the new keyword
  if (!(this instanceof WrapperError)) {
    return new WrapperError(message, innerError);
  }

  Error.call(this);
  Error.captureStackTrace(this, WrapperError);

  this.message = message;
  this.innerError = innerError;
}
1248208
function normalizeError(err, stack) {
  err = coerceToError(err)
  if (!err.normalized) {
    addNonEnumerableValue(err, 'originalStack', stack || err.message)
    addNonEnumerableValue(err, 'normalized', true)
    addNonEnumerableValue(err, 'coreThrown', isCoreError(err))
    addNonEnumerableValue(err, 'catchable', isCatchableError(err))
  }
  return err
}
894095
def add_error(name=None, code=None, status=None):
    """"""
    if not name or not status or not code:
        raise Exception("Can't create Exception class %s: you must set both name, status and code" % name)
    myexception = type(name, (PyMacaronException, ), {"code": code, "status": status})
    globals()[name] = myexception
    if code in code_to_class:
        raise Exception("ERROR! Exception %s is already defined." % code)
    code_to_class[code] = myexception
    return myexception
583944
function raise( caller, msg, val ) {
            var error = new Error( [
                'new BigNumber',     // 0
                'cmp',               // 1
                'config',            // 2
                'div',               // 3
                'divToInt',          // 4
                'eq',                // 5
                'gt',                // 6
                'gte',               // 7
                'lt',                // 8
                'lte',               // 9
                'minus',             // 10
                'mod',               // 11
                'plus',              // 12
                'precision',         // 13
                'random',            // 14
                'round',             // 15
                'shift',             // 16
                'times',             // 17
                'toDigits',          // 18
                'toExponential',     // 19
                'toFixed',           // 20
                'toFormat',          // 21
                'toFraction',        // 22
                'pow',               // 23
                'toPrecision',       // 24
                'toString',          // 25
                'BigNumber'          // 26
            ][caller] + '() ' + msg + ': ' + val );

            error.name = 'BigNumber Error';
            id = 0;
            throw error;
        }
1263787
function TypeError (msg, spec, value) {
  const e = Error(msg)
  return Object.assign(e, { spec, value })
}
584663
def error(code, message, **kwargs):
        """"""
        assert code in Logger._error_code_to_exception
        exc_type, domain = Logger._error_code_to_exception[code]
        exc = exc_type(message, **kwargs)
        Logger._log(code, exc.message, ERROR, domain)
        raise exc
148521
function(i) {
        if (expected[i] == undefined) return 'exception'
        switch (expected[i].constructor) {
          case RegExp   : return 'exception matching ' + puts(expected[i])
          case String   : return 'exception of ' + puts(expected[i])
          case Function : return expected[i].name || 'Error'
        }
      }
632887
def error_catcher(self, extra_info: Optional[str] = None):
        
        try:
            yield
        except InstaloaderException as err:
            if extra_info:
                self.error('{}: {}'.format(extra_info, err))
            else:
                self.error('{}'.format(err))
            if self.raise_all_errors:
                raise
1262620
function ParseError(message, input) {
  Error.captureStackTrace(this, ParseError);

  this.name = this.constructor.name;
  this.message = message;
  this.input = input;
}