mirror of https://github.com/nodejs/node.git
Expose errno with a string for dns/cares
This is to mirror the behavior introduced in
aa95e5708f
.
Closes GH-727.
pull/22966/head
parent
d664bf376d
commit
0304f1fc22
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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…
Reference in New Issue