/
eb
/
Surf
Обзор
Документация
Войти
/
eb
/
Surf
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/es5-ext/error/custom.js
20 строк
592 B
EvgeniyBudaev
Initial commit
17 фев 2020, 09:02
17 фев 2020, 09:02
bb6f06f
Код
Авторство
О чём код?
"use strict"; var assign = require("../object/assign") , isObject = require("../object/is-object") , isValue = require("../object/is-value") , captureStackTrace = Error.captureStackTrace; exports = module.exports = function (message/*, code, ext*/) { var err = new Error(message), code = arguments[1], ext = arguments[2]; if (!isValue(ext)) { if (isObject(code)) { ext = code; code = null; } } if (isValue(ext)) assign(err, ext); if (isValue(code)) err.code = code; if (captureStackTrace) captureStackTrace(err, exports); return err; };