NodeJS에러 코드를 보다보면, 축약어의 형태로 나오는 경우들이 있는데요.
오늘은 그것들은 한번 정리해보고자 합니다.
1. 자주 쓰이는 시스템 에러로그
EACCES (Permission denied)
An attempt was made to access a file in a way forbidden by its file access permissions.
EADDRINUSE (Address already in use)
An attempt to bind a server (net, http, or https) to a local address failed due to another server on the local system already occupying that address.
ECONNREFUSED (Connection refused)
No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host.
ECONNRESET (Connection reset by peer)
A connection was forcibly closed by a peer. This normally results from a loss of the connection on the remote socket due to a timeout or reboot. Commonly encountered via the http and net modules.
EEXIST (File exists)
An existing file was the target of an operation that required that the target not exist.
EISDIR (Is a directory)
An operation expected a file, but the given pathname was a directory.
EMFILE (Too many open files in system)
Maximum number of file descriptors allowable on the system has been reached, and requests for another descriptor cannot be fulfilled until at least one has been closed. This is encountered when opening many files at once in parallel, especially on systems (in particular, macOS) where there is a low file descriptor limit for processes. To remedy a low limit, run ulimit -n 2048 in the same shell that will run the Node.js process.
ENOENT (No such file or directory)
Commonly raised by fs operations to indicate that a component of the specified pathname does not exist -- no entity (file or directory) could be found by the given path.
ENOTDIR (Not a directory):
A component of the given pathname existed, but was not a directory as expected. Commonly raised by fs.readdir.
ENOTEMPTY (Directory not empty):
A directory with entries was the target of an operation that requires an empty directory -- usually fs.unlink.
EPERM (Operation not permitted):
An attempt was made to perform an operation that requires elevated privileges.
EPIPE (Broken pipe):
A write on a pipe, socket, or FIFO for which there is no process to read the data. Commonly encountered at the net and http layers, indicative that the remote side of the stream being written to has been closed.
ETIMEDOUT (Operation timed out):
A connect or send request failed because the connected party did not properly respond after a period of time. Usually encountered by http or net -- often a sign that a socket.end() was not properly called.
EAI_AGAIN (DNS lookup timed out error,):
temporary failure in name resolution or simply the name server returned a temporary failure indication
2. 기타 에러로그들
E2BIG
argument list too long
EADDRNOTAVAIL
address not available
EAFNOSUPPORT, "
address family not supported") \
EAGAIN
resource temporarily unavailable
EAI_ADDRFAMILY
address family not supported
EAI_AGAIN, "
temporary failure
EAI_BADFLAGS
bad ai_flags value
EAI_BADHINTS
invalid value for hints
EAI_CANCELED
request canceled
EAI_FAIL
permanent failure
EAI_FAMILY
ai_family not supported
EAI_MEMORY
out of memory
XX(EAI_NODATA, "no address") \
XX(EAI_NONAME, "unknown node or service") \
XX(EAI_OVERFLOW, "argument buffer overflow") \
XX(EAI_PROTOCOL, "resolved protocol is unknown") \
XX(EAI_SERVICE, "service not available for socket type") \
XX(EAI_SOCKTYPE, "socket type not supported") \
XX(EAI_SYSTEM, "system error") \
XX(EALREADY, "connection already in progress") \
XX(EBADF, "bad file descriptor") \
XX(EBUSY, "resource busy or locked") \
XX(ECANCELED, "operation canceled") \
XX(ECHARSET, "invalid Unicode character") \
XX(ECONNABORTED, "software caused connection abort") \
XX(ECONNREFUSED, "connection refused") \
XX(ECONNRESET, "connection reset by peer") \
XX(EDESTADDRREQ, "destination address required") \
XX(EEXIST, "file already exists") \
XX(EFAULT, "bad address in system call argument") \
XX(EFBIG, "file too large") \
XX(EHOSTUNREACH, "host is unreachable") \
XX(EINTR, "interrupted system call") \
XX(EINVAL, "invalid argument") \
XX(EIO, "i/o error") \
XX(EISCONN, "socket is already connected") \
XX(EISDIR, "illegal operation on a directory") \
XX(ELOOP, "too many symbolic links encountered") \
XX(EMFILE, "too many open files") \
XX(EMSGSIZE, "message too long") \
XX(ENAMETOOLONG, "name too long") \
XX(ENETDOWN, "network is down") \
XX(ENETUNREACH, "network is unreachable") \
XX(ENFILE, "file table overflow") \
XX(ENOBUFS, "no buffer space available") \
XX(ENODEV, "no such device") \
XX(ENOENT, "no such file or directory") \
XX(ENOMEM, "not enough memory") \
XX(ENONET, "machine is not on the network") \
XX(ENOPROTOOPT, "protocol not available") \
XX(ENOSPC, "no space left on device") \
XX(ENOSYS, "function not implemented") \
XX(ENOTCONN, "socket is not connected") \
XX(ENOTDIR, "not a directory") \
XX(ENOTEMPTY, "directory not empty") \
XX(ENOTSOCK, "socket operation on non-socket") \
XX(ENOTSUP, "operation not supported on socket") \
XX(EPERM, "operation not permitted") \
XX(EPIPE, "broken pipe") \
XX(EPROTO, "protocol error") \
XX(EPROTONOSUPPORT, "protocol not supported") \
XX(EPROTOTYPE, "protocol wrong type for socket") \
XX(ERANGE, "result too large") \
XX(EROFS, "read-only file system") \
XX(ESHUTDOWN, "cannot send after transport endpoint shutdown") \
XX(ESPIPE, "invalid seek") \
XX(ESRCH, "no such process") \
XX(ETIMEDOUT, "connection timed out") \
XX(ETXTBSY, "text file is busy") \
XX(EXDEV, "cross-device link not permitted") \
XX(UNKNOWN, "unknown error") \
XX(EOF, "end of file") \
XX(ENXIO, "no such device or address") \
XX(EMLINK, "too many links") \
'NodeJS' 카테고리의 다른 글
Promise 를 사용해보자 (0) | 2019.05.30 |
---|---|
NodeJS에서 Header 값 받아오기 (1) | 2019.03.31 |
NodeJS에서 활용하는 process.env (1) | 2019.03.26 |
NodeJS에서 사용하는 Logging모듈 Winston (0) | 2018.04.03 |
NodeJS 에서 Crash 후 재시작에 필요한 PM2 (0) | 2017.10.23 |