Basically, uv_inet_pton doesn't set errno. It's cross platform, you can check the code in src/inet.c, so all you need to do is:

~~~~~
return uv_inet_pton(AF_INET, ip, &(addr->sin_addr.s_addr));
~~~~~

Because uv_inet_pton already returns 0 in case everything went OK and a UV_EXXX error otherwise.