You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #43, it looks like we slightly changed the error handling behaviour. Repro:
constCacheableLookup=require('cacheable-lookup');constcl=newCacheableLookup({lookup: (hostname,options,callback)=>{setTimeout(()=>{callback(Object.assign(newError('Fake DNS error'),{code: 'EAI_AGAIN'}));},10);}});cl.lookup('example.test',(result)=>{console.log('Got result',result);});
In 6.0.1, this returns Error: cacheableLookup ENOTFOUND example.test
In 6.0.2, this returns Error: Fake DNS error
This affects any cases where normal resolution fails with ENOTFOUND or ENODATA, and then fallback fails with some other error. Previously we treated that as an ENOTFOUND result, now we use the fallback's error instead.
I think this comes from c5d06c5 (#43), which removed the try/catch inside _lookup.
I don't think this is necessarily wrong, but it's a change in behaviour that I don't think was intentional. What should happen in this case?
The text was updated successfully, but these errors were encountered:
Well, to be honest we can either throw the lookup error or ENOTFOUND. The previous behavior was to ignore any lookup errors if real DNS queries were successful, which I'm not sure is the right behavior. Will do a release soon.
In #43, it looks like we slightly changed the error handling behaviour. Repro:
In 6.0.1, this returns
Error: cacheableLookup ENOTFOUND example.test
In 6.0.2, this returns
Error: Fake DNS error
This affects any cases where normal resolution fails with ENOTFOUND or ENODATA, and then fallback fails with some other error. Previously we treated that as an ENOTFOUND result, now we use the fallback's error instead.
I think this comes from
c5d06c5
(#43), which removed the try/catch inside _lookup.I don't think this is necessarily wrong, but it's a change in behaviour that I don't think was intentional. What should happen in this case?
The text was updated successfully, but these errors were encountered: