In libuv errors are negative numbered constants. As a rule of thumb, whenever there is a status parameter, or an API functions returns an integer, a negative number will imply an error.
When a function which takes a callback returns an error, the callback will never be called.
Note Implementation detail: on Unix error codes are the negated errno (or -errno), while on Windows they are defined by libuv to arbitrary negative numbers.
Error handling <libuv 1.10.3-dev API documentation>
Vars
E2BIG: cint
- argument list too long Source Edit
EACCES: cint
- permission denied Source Edit
EADDRINUSE: cint
- address already in use Source Edit
EADDRNOTAVAIL: cint
- address not available Source Edit
EAFNOSUPPORT: cint
- address family not supported Source Edit
EAGAIN: cint
- resource temporarily unavailable Source Edit
EAI_ADDRFAMILY: cint
- address family not supported Source Edit
EAI_AGAIN: cint
- temporary failure Source Edit
EAI_BADFLAGS: cint
- bad ai_flags value Source Edit
EAI_BADHINTS: cint
- invalid value for hints Source Edit
EAI_CANCELED: cint
- request canceled Source Edit
EAI_FAIL: cint
- permanent failure Source Edit
EAI_FAMILY: cint
- ai_family not supported Source Edit
EAI_MEMORY: cint
- out of memory Source Edit
EAI_NODATA: cint
- no address Source Edit
EAI_NONAME: cint
- unknown node or service Source Edit
EAI_OVERFLOW: cint
- argument buffer overflow Source Edit
EAI_PROTOCOL: cint
- resolved protocol is unknown Source Edit
EAI_SERVICE: cint
- service not available for socket type Source Edit
EAI_SOCKTYPE: cint
- socket type not supported Source Edit
EALREADY: cint
- connection already in progress Source Edit
EBADF: cint
- bad file descriptor Source Edit
EBUSY: cint
- resource busy or locked Source Edit
ECANCELED: cint
- operation canceled Source Edit
ECHARSET: cint
- invalid Unicode character Source Edit
ECONNABORTED: cint
- software caused connection abort Source Edit
ECONNREFUSED: cint
- connection refused Source Edit
ECONNRESET: cint
- connection reset by peer Source Edit
EDESTADDRREQ: cint
- destination address required Source Edit
EEXIST: cint
- file already exists Source Edit
EFAULT: cint
- bad address in system call argument Source Edit
EFBIG: cint
- file too large Source Edit
EHOSTUNREACH: cint
- host is unreachable Source Edit
EINTR: cint
- interrupted system call Source Edit
EINVAL: cint
- invalid argument Source Edit
EIO: cint
- i/o error Source Edit
EISCONN: cint
- socket is already connected Source Edit
EISDIR: cint
- illegal operation on a directory Source Edit
ELOOP: cint
- too many symbolic links encountered Source Edit
EMFILE: cint
- too many open files Source Edit
EMSGSIZE: cint
- message too long Source Edit
ENAMETOOLONG: cint
- name too long Source Edit
ENETDOWN: cint
- network is down Source Edit
ENETUNREACH: cint
- network is unreachable Source Edit
ENFILE: cint
- file table overflow Source Edit
ENOBUFS: cint
- no buffer space available Source Edit
ENODEV: cint
- no such device Source Edit
ENOENT: cint
- no such file or directory Source Edit
ENOMEM: cint
- not enough memory Source Edit
ENONET: cint
- machine is not on the network Source Edit
ENOPROTOOPT: cint
- protocol not available Source Edit
ENOSPC: cint
- no space left on device Source Edit
ENOSYS: cint
- function not implemented Source Edit
ENOTCONN: cint
- socket is not connected Source Edit
ENOTDIR: cint
- not a directory Source Edit
ENOTEMPTY: cint
- directory not empty Source Edit
ENOTSOCK: cint
- socket operation on non-socket Source Edit
ENOTSUP: cint
-  operation not supported on socket Source Edit
EPERM: cint
- operation not permitted Source Edit
EPIPE: cint
- broken pipe Source Edit
EPROTO: cint
- protocol error Source Edit
EPROTONOSUPPORT: cint
- protocol not supported Source Edit
EPROTOTYPE: cint
- protocol wrong type for socket Source Edit
ERANGE: cint
- result too large Source Edit
EROFS: cint
- read-only file system Source Edit
ESHUTDOWN: cint
- cannot send after transport endpoint shutdown Source Edit
ESPIPE: cint
- invalid seek Source Edit
ESRCH: cint
- no such process Source Edit
ETIMEDOUT: cint
- connection timed out Source Edit
ETXTBSY: cint
- text file is busy Source Edit
EXDEV: cint
- cross-device link not permitted Source Edit
UNKNOWN: cint
- unknown error Source Edit
EOF: cint
- end of file Source Edit
ENXIO: cint
- no such device or address Source Edit
EMLINK: cint
- too many links Source Edit
EHOSTDOWN: cint
- host is down Source Edit
Procs
proc strError(errCode: cint): cstring {.
importc: "uv_strerror", header: "uv.h".}- Returns the error message for the given error code. Leaks a few bytes of memory when you call it with an unknown error code. Source Edit
proc errName(errCode: cint): cstring {.
importc: "uv_err_name", header: "uv.h".}- Returns the error name for the given error code. Leaks a few bytes of memory when you call it with an unknown error code. Source Edit
proc translateSysError(errCode: cint): cstring {.
importc: "uv_translate_sys_error", header: "uv.h".}-
Returns the libuv error code equivalent to the given platform dependent error code: POSIX error codes on Unix (the ones stored in errno), and Win32 error codes on Windows (those returned by GetLastError() or WSAGetLastError()).
If errCode is already a libuv error, it is simply returned.
Source Edit