szmarczak / cacheable-lookup

A cacheable dns.lookup(…) that respects TTL :tada:
MIT License
190 stars 29 forks source link

Handle ENOENT Windows lookup failures #50

Closed pimterry closed 2 years ago

pimterry commented 2 years ago

Fixes #49

This can happen when, for example, you query with {family:6} on Windows but only IPv4 resolution is available.

It's very difficult to pin down all the possible error cases for DNS, but I think this happens because:

This shouldn't ever be returned on Unix OSs, which have their own separate & fixed list of possible errors (here).

There's more discussion and an (unmerged) PR to fix this properly and line up Unix & Windows DNS error handling here: https://github.com/libuv/libuv/issues/2959

codecov-commenter commented 2 years ago

Codecov Report

Merging #50 (c39038f) into master (4a22f87) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #50   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files           1        1           
  Lines         197      197           
=======================================
  Hits          195      195           
  Misses          2        2           
Impacted Files Coverage Δ
source/index.js 98.98% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4a22f87...c39038f. Read the comment docs.

szmarczak commented 2 years ago

Thanks! 🙌🏼 Released 6.0.4

pimterry commented 2 years ago

Awesome, thanks! :+1: