D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
lib
/
node_modules
/
npm
/
lib
/
install
/
Filename :
and-add-parent-to-errors.js
back
Copy
'use strict' var moduleName = require('../utils/module-name.js') var validate = require('aproba') module.exports = function (parent, cb) { validate('F', [cb]) return function (er) { if (!er) return cb.apply(null, arguments) if (er instanceof Error && parent && parent.package && parent.package.name) { er.parent = moduleName(parent) } cb(er) } }