Browse Source

Expose errno with a string for dns/cares

This is to mirror the behavior introduced in
aa95e5708f.

Closes GH-727.
v0.7.4-release
Felix Geisendörfer 14 years ago
committed by Ryan Dahl
parent
commit
0304f1fc22
  1. 1
      src/node_cares.cc
  2. 1
      test/simple/test-http-dns-fail.js

1
src/node_cares.cc

@ -216,6 +216,7 @@ static void ResolveError(Persistent<Function> &cb, int status) {
Local<Object> obj = e->ToObject(); Local<Object> obj = e->ToObject();
obj->Set(String::NewSymbol("errno"), Integer::New(status)); obj->Set(String::NewSymbol("errno"), Integer::New(status));
obj->Set(String::NewSymbol("code"), code);
TryCatch try_catch; TryCatch try_catch;

1
test/simple/test-http-dns-fail.js

@ -24,6 +24,7 @@ function httpreq(count) {
req.on('error', function(e){ req.on('error', function(e){
console.log(e.message); console.log(e.message);
assert.strictEqual(e.code, 'ENOTFOUND');
hadError++ hadError++
httpreq(count + 1) httpreq(count + 1)
}) })

Loading…
Cancel
Save