Planeshifter / node-concept-net

node.js interface to the ConceptNet semantic network API [DEPRECATED; ConceptNet API has changed]
MIT License
29 stars 3 forks source link

Handle errors of HTTP requests #6

Closed yboyer-winn closed 6 years ago

yboyer-winn commented 6 years ago

On some cases, the request fails. And, as a failure, the Node app crash.

events.js:163
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND conceptnet5.media.mit.edu conceptnet5.media.mit.edu:80
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)
Planeshifter commented 6 years ago

Thanks for the pull request!