123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- var all = module.exports.all = [
- {
- errno: -2,
- code: 'ENOENT',
- description: 'no such file or directory'
- },
- {
- errno: -1,
- code: 'UNKNOWN',
- description: 'unknown error'
- },
- {
- errno: 0,
- code: 'OK',
- description: 'success'
- },
- {
- errno: 1,
- code: 'EOF',
- description: 'end of file'
- },
- {
- errno: 2,
- code: 'EADDRINFO',
- description: 'getaddrinfo error'
- },
- {
- errno: 3,
- code: 'EACCES',
- description: 'permission denied'
- },
- {
- errno: 4,
- code: 'EAGAIN',
- description: 'resource temporarily unavailable'
- },
- {
- errno: 5,
- code: 'EADDRINUSE',
- description: 'address already in use'
- },
- {
- errno: 6,
- code: 'EADDRNOTAVAIL',
- description: 'address not available'
- },
- {
- errno: 7,
- code: 'EAFNOSUPPORT',
- description: 'address family not supported'
- },
- {
- errno: 8,
- code: 'EALREADY',
- description: 'connection already in progress'
- },
- {
- errno: 9,
- code: 'EBADF',
- description: 'bad file descriptor'
- },
- {
- errno: 10,
- code: 'EBUSY',
- description: 'resource busy or locked'
- },
- {
- errno: 11,
- code: 'ECONNABORTED',
- description: 'software caused connection abort'
- },
- {
- errno: 12,
- code: 'ECONNREFUSED',
- description: 'connection refused'
- },
- {
- errno: 13,
- code: 'ECONNRESET',
- description: 'connection reset by peer'
- },
- {
- errno: 14,
- code: 'EDESTADDRREQ',
- description: 'destination address required'
- },
- {
- errno: 15,
- code: 'EFAULT',
- description: 'bad address in system call argument'
- },
- {
- errno: 16,
- code: 'EHOSTUNREACH',
- description: 'host is unreachable'
- },
- {
- errno: 17,
- code: 'EINTR',
- description: 'interrupted system call'
- },
- {
- errno: 18,
- code: 'EINVAL',
- description: 'invalid argument'
- },
- {
- errno: 19,
- code: 'EISCONN',
- description: 'socket is already connected'
- },
- {
- errno: 20,
- code: 'EMFILE',
- description: 'too many open files'
- },
- {
- errno: 21,
- code: 'EMSGSIZE',
- description: 'message too long'
- },
- {
- errno: 22,
- code: 'ENETDOWN',
- description: 'network is down'
- },
- {
- errno: 23,
- code: 'ENETUNREACH',
- description: 'network is unreachable'
- },
- {
- errno: 24,
- code: 'ENFILE',
- description: 'file table overflow'
- },
- {
- errno: 25,
- code: 'ENOBUFS',
- description: 'no buffer space available'
- },
- {
- errno: 26,
- code: 'ENOMEM',
- description: 'not enough memory'
- },
- {
- errno: 27,
- code: 'ENOTDIR',
- description: 'not a directory'
- },
- {
- errno: 28,
- code: 'EISDIR',
- description: 'illegal operation on a directory'
- },
- {
- errno: 29,
- code: 'ENONET',
- description: 'machine is not on the network'
- },
- {
- errno: 31,
- code: 'ENOTCONN',
- description: 'socket is not connected'
- },
- {
- errno: 32,
- code: 'ENOTSOCK',
- description: 'socket operation on non-socket'
- },
- {
- errno: 33,
- code: 'ENOTSUP',
- description: 'operation not supported on socket'
- },
- {
- errno: 34,
- code: 'ENOENT',
- description: 'no such file or directory'
- },
- {
- errno: 35,
- code: 'ENOSYS',
- description: 'function not implemented'
- },
- {
- errno: 36,
- code: 'EPIPE',
- description: 'broken pipe'
- },
- {
- errno: 37,
- code: 'EPROTO',
- description: 'protocol error'
- },
- {
- errno: 38,
- code: 'EPROTONOSUPPORT',
- description: 'protocol not supported'
- },
- {
- errno: 39,
- code: 'EPROTOTYPE',
- description: 'protocol wrong type for socket'
- },
- {
- errno: 40,
- code: 'ETIMEDOUT',
- description: 'connection timed out'
- },
- {
- errno: 41,
- code: 'ECHARSET',
- description: 'invalid Unicode character'
- },
- {
- errno: 42,
- code: 'EAIFAMNOSUPPORT',
- description: 'address family for hostname not supported'
- },
- {
- errno: 44,
- code: 'EAISERVICE',
- description: 'servname not supported for ai_socktype'
- },
- {
- errno: 45,
- code: 'EAISOCKTYPE',
- description: 'ai_socktype not supported'
- },
- {
- errno: 46,
- code: 'ESHUTDOWN',
- description: 'cannot send after transport endpoint shutdown'
- },
- {
- errno: 47,
- code: 'EEXIST',
- description: 'file already exists'
- },
- {
- errno: 48,
- code: 'ESRCH',
- description: 'no such process'
- },
- {
- errno: 49,
- code: 'ENAMETOOLONG',
- description: 'name too long'
- },
- {
- errno: 50,
- code: 'EPERM',
- description: 'operation not permitted'
- },
- {
- errno: 51,
- code: 'ELOOP',
- description: 'too many symbolic links encountered'
- },
- {
- errno: 52,
- code: 'EXDEV',
- description: 'cross-device link not permitted'
- },
- {
- errno: 53,
- code: 'ENOTEMPTY',
- description: 'directory not empty'
- },
- {
- errno: 54,
- code: 'ENOSPC',
- description: 'no space left on device'
- },
- {
- errno: 55,
- code: 'EIO',
- description: 'i/o error'
- },
- {
- errno: 56,
- code: 'EROFS',
- description: 'read-only file system'
- },
- {
- errno: 57,
- code: 'ENODEV',
- description: 'no such device'
- },
- {
- errno: 58,
- code: 'ESPIPE',
- description: 'invalid seek'
- },
- {
- errno: 59,
- code: 'ECANCELED',
- description: 'operation canceled'
- }
- ]
-
- module.exports.errno = {}
- module.exports.code = {}
-
- all.forEach(function (error) {
- module.exports.errno[error.errno] = error
- module.exports.code[error.code] = error
- })
-
- module.exports.custom = require('./custom')(module.exports)
- module.exports.create = module.exports.custom.createError
|