FUNCTION: error( err, env )
Creates an error tailored to the module.

@param {Error|TypeError|RangeError} err - error object
@param {String} env - environment variable name
@returns {Error|TypeError|RangeError} error object
549662
function error( err, env ) {
	var msg = err.message;
	var out;

	msg += ' Environment variable: `' + env + '`.';
	if ( err instanceof TypeError ) {

		out = new TypeError( msg );
	}
	else if ( err instanceof RangeError ) {
		out = new RangeError( msg );
	}
	else {
		out = new Error( msg );
	}
	return out;
}
794200
def _make_error(index, code, errmsg, operation):
    
    return {
        _UINDEX: index,
        _UCODE: code,
        _UERRMSG: errmsg,
        _UOP: operation
    }
807764
function onError(err) {
    const ctx = err.client.$ctx;
    npm.events.error(ctx.options, err, {
        cn: npm.utils.getSafeConnection(ctx.cn),
        dc: ctx.dc
    });
}
126931
function _runError(error, module) {
  const _error = new emitter.Error({
    target:module.filename,
    source:(module.parent || module).filename,
    error
  });
  module.exports = _error;
  emitter.emit('error', _error);
  return (!!_error.ignore || (_error.ignore && isFunction(_error.ignore) && _error.ignore()));
}
9553
def make_err(self, errtype, message, original, loc, ln=None, reformat=True, *args, **kwargs):
        """"""
        if ln is None:
            ln = self.adjust(lineno(loc, original))
        errstr, index = getline(loc, original), col(loc, original) - 1
        if reformat:
            errstr, index = self.reformat(errstr, index)
        return errtype(message, errstr, index, ln, *args, **kwargs)
830832
function encodeError(err, header) {
  return Buffer.concat([
    header || new Buffer([0]), // Recover the header if possible.
    new Buffer([1, 0]), // Error flag and first union index.
    STRING_TYPE.toBuffer(err.message)
  ]);
}
339252
function recreateError(err) {
	const Class = module.exports[err.name];
	if (Class) {
		switch(err.name) {
			case "MoleculerError": return new Class(err.message, err.code, err.type, err.data);
			case "MoleculerRetryableError": return new Class(err.message, err.code, err.type, err.data);
			case "MoleculerServerError": return new Class(err.message, err.code, err.type, err.data);
			case "MoleculerClientError": return new Class(err.message, err.code, err.type, err.data);

			case "ValidationError": return new Class(err.message, err.type, err.data);

			case "ServiceNotFoundError": return new Class(err.data);
			case "ServiceNotAvailableError": return new Class(err.data);
			case "RequestTimeoutError": return new Class(err.data);
			case "RequestSkippedError": return new Class(err.data);
			case "RequestRejectedError": return new Class(err.data);
			case "QueueIsFullError": return new Class(err.data);
			case "MaxCallLevelError": return new Class(err.data);
			case "GracefulStopTimeoutError": return new Class(err.data);
			case "ProtocolVersionMismatchError": return new Class(err.data);
			case "InvalidPacketDataError": return new Class(err.data);

			case "ServiceSchemaError":
			case "BrokerOptionsError": return new Class(err.message, err.data);
		}
	}
}
1155277
function (err) {
                var responseOptions = new __WEBPACK_IMPORTED_MODULE_3__base_response_options__["b" /* ResponseOptions */]({
                    body: err,
                    type: __WEBPACK_IMPORTED_MODULE_4__enums__["d" /* ResponseType */].Error,
                    status: _xhr.status,
                    statusText: _xhr.statusText,
                });
                if (baseResponseOptions != null) {
                    responseOptions = baseResponseOptions.merge(responseOptions);
                }
                responseObserver.error(new __WEBPACK_IMPORTED_MODULE_8__static_response__["a" /* Response */](responseOptions));
            }
1026434
function normalizeError(err) {
  if (err && err.document && err.document.Error && err.document.Error.Message) {
    var e = new Error(err.document.Error.Message);
    e.name = err.document.Error.Code ? 'SQS:' + err.document.Error.Code : 'SQS:Error';
    throw e;
  } else {
    throw err;
  }
}
232575
function VError(options)
{
	var args, causedBy, ctor, tailmsg;

	if (options instanceof Error || typeof (options) === 'object') {
		args = Array.prototype.slice.call(arguments, 1);
	} else {
		args = Array.prototype.slice.call(arguments, 0);
		options = undefined;
	}

	tailmsg = args.length > 0 ?
	    mod_extsprintf.sprintf.apply(null, args) : '';
	this.jse_shortmsg = tailmsg;
	this.jse_summary = tailmsg;

	if (options) {
		causedBy = options.cause;

		if (!causedBy || !(options.cause instanceof Error))
			causedBy = options;

		if (causedBy && (causedBy instanceof Error)) {
			this.jse_cause = causedBy;
			this.jse_summary += ': ' + causedBy.message;
		}
	}

	this.message = this.jse_summary;
	Error.call(this, this.jse_summary);

	if (Error.captureStackTrace) {
		ctor = options ? options.constructorOpt : undefined;
		ctor = ctor || arguments.callee;
		Error.captureStackTrace(this, ctor);
	}
}
668027
function(err) {
            Dialogs.alert("Error:", err.message || err);
            console.error(err.stack || err.message || err);
            return Q.reject(err);
        }
604096
function(err, res) {
	      console.log(err);
	      res.reply(mInstance.conf.CONST.ERR);
	      return;
	    }
563920
function sendError(req, res, err) {
        return res.end("(" + function (err) {
            throw new Error(err)
        } + "(" + JSON.stringify(err.message) + "))")
    }
1238592
function formatError(err, input) {
    var msg = err.message.replace(/\s*\(\d*\:\d*\)\s*$/i, ''); // remove line number / col number

    var bm = ('' + input.slice(0, err.pos)).match(/.*$/i);
    var am = ('' + input.slice(err.pos)).match(/.*/i);
    var before = bm ? bm[0] : '';
    var after = am ? am[0] : '';

    // Prepare line info for txt display
    var cursorPos = before.length;
    var lineStr = before + after;
    var lncursor = [];
    for (var i = 0, sz = lineStr.length; sz > i; i++) {
        lncursor[i] = (i === cursorPos) ? '\u005E' : '-';
    }
    var lineInfoTxt = lineStr + '\n' + lncursor.join('');

    return {
        description: msg,
        lineInfoTxt: lineInfoTxt,
        code: lineStr,
        line: err.loc ? err.loc.line : -1,
        column: err.loc ? err.loc.column : -1
    };
}
1027972
function makeError(code, text) {
  var err = new Error(text);
  err.code = code;
  return err;
}
533560
function(errOrMessage, result) {
        var err = (errOrMessage instanceof Error) ? errOrMessage : new Error(errOrMessage);
        result = result || {};
        result.error = err;
        result.status = 'error';
        err.result = result;
        return err;
    }
792943
function UnknownEnvNameError (e) {

    e = e || {};

    var environmentName = e.environmentName || '';

    this.message = 'No config for environment name "' + environmentName + '"';
    this.code = ERR_NO_SUCH_ENVIRONMENT;
    this.environmentName = environmentName;

}