moonpyk / node-ntp-client

Pure Javascript implementation of the NTP Client Protocol
MIT License
58 stars 42 forks source link

Unhandled error event #3

Closed naggie closed 10 years ago

naggie commented 10 years ago

Presumably the error event (from DNS I think) should be passed on to the callback. It makes this library un-usable as it causes the whole app to crash out. This is with using a non-existant hostname:

$ node lib/entities/Ntp.js
{ [Error: getaddrinfo EIO] code: 'EIO', errno: 'EIO', syscall: 'getaddrinfo' }

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: getaddrinfo EIO
    at errnoException (dns.js:37:11)
    at Object.onanswer [as oncomplete] (dns.js:124:16)
naggie commented 10 years ago

See PR