
| Current Path : /proc/thread-self/root/usr/share/nodejs/err-code/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //proc/thread-self/root/usr/share/nodejs/err-code/index.js |
'use strict';
function createError(err, code, props) {
var key;
if (!(err instanceof Error)) {
throw new TypeError('Please pass an Error to err-code');
}
if (typeof code === 'object') {
props = code;
} else if (code != null) {
err.code = code;
}
if (props) {
for (key in props) {
err[key] = props[key];
}
}
return err;
}
module.exports = createError;