Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function (err) {
var str = 'Error: '
// If it's a libuv error then get the description from errno
if (errno.errno[err.errno]) {
str += errno.errno[err.errno].description
} else {
str += err.message
}
// If it's an fs error then it'll have a 'path' property
if (err.path) {
str += ' [' + err.path + ']'
}
console.log(str)
process.exit(err.code || 1)
}
module.exports = function (err) {
var str = 'Error: '
// If it's a libuv error then get the description from errno
if (errno.errno[err.errno]) {
str += errno.errno[err.errno].description
} else {
str += err.message
}
// If it's an fs error then it'll have a 'path' property
if (err.path) {
str += ' [' + err.path + ']'
}
console.log(str)
process.exit(err.code || 1)
}
var status = ntstatus.STATUS_UNSUCCESSFUL;
var msg = err;
if (typeof msg != 'string') {
msg = err.message || ntstatus.STATUS_TO_STRING[status] || 'unknown error';
/**
* err.syscall
* err.errno
* err.code
* err.path
*/
if (err.errno || err.code) {
var code = err.code;
if (errno.errno[err.errno]) {
msg = errno.errno[err.errno].description;
code = errno.errno[err.errno].code;
}
if (err.path) {
msg += ' [' + err.path + ']';
}
// the code:errno mapping is not unique (see e.g. 'ENOENT') ...
switch (code) {
case 'EINVAL':
status = ntstatus.STATUS_NOT_IMPLEMENTED;
break;
case 'ENOENT':
status = ntstatus.STATUS_NO_SUCH_FILE;
break;
case 'EPERM':
status = ntstatus.STATUS_ACCESS_DENIED;
function errmsg(err) {
var str = 'Error: '
// if it's a libuv error then get the description from errno
if (errno.errno[err.errno]) {
str += errno.errno[err.errno].description
} else {
str += err.message
}
// if it's a `fs` error then it'll have a 'path' property
if (err.path) {
str += ' [' + err.path + ']'
}
return str
}
function errmsg(err) {
var str = 'Error: '
// if it's a libuv error then get the description from errno
if (errno.errno[err.errno]) {
str += errno.errno[err.errno].description
} else {
str += err.message
}
// if it's a `fs` error then it'll have a 'path' property
if (err.path) {
str += ' [' + err.path + ']'
}
return str
}
function errmsg(err) {
var str = 'Error: ';
if (errno.errno[err.errno]) {
str += errno.errno[err.errno].description;
} else {
str += err.message;
}
if (err.path) {
str += ' [' + err.path + ']';
}
return str;
}
var errno = require('errno').errno;
var ffi = require('ffi');
var libc = ffi.Library(null, {
'ioctl': [ 'int', [ 'int', 'long', 'int' ] ]
});
module.exports = function(fd, request, arg) {
var err;
if (libc.ioctl(fd, request, arg) === -1) {
var no = ffi.errno();
err = new Error(errno[no].code + ': ' + errno[no].description + ', ioctl');
}
};
function makeMsg (err) {
var message
if (err && err.message)
message = err.message
else
message = String(err || '')
if (err && err.errno && errno.errno[err.errno])
message += ' (' + errno.errno[err.errno].description + ')'
return message
}
function makeMsg (err) {
var message
if (err && err.message)
message = err.message
else
message = String(err || '')
if (err && err.errno && errno.errno[err.errno])
message += ' (' + errno.errno[err.errno].description + ')'
return message
}
function errmsg(err) {
var str = 'Error: ';
if (errno.errno[err.errno]) {
str += errno.errno[err.errno].description;
} else {
str += err.message;
}
if (err.path) {
str += ' [' + err.path + ']';
}
return str;
}