Skip to content

Commit

Permalink
Fix the documentation of dns error handling.
Browse files Browse the repository at this point in the history
These are actually passed as Error objects, not separate "code" and "message"
parameters.
  • Loading branch information
mbrubeck committed Jan 13, 2010
1 parent c4397b8 commit bd4f56c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions doc/api.txt
Expand Up @@ -1410,14 +1410,14 @@ resolution.addCallback(function (addresses, ttl, cname) {
reversing.addCallback( function (domains, ttl, cname) { reversing.addCallback( function (domains, ttl, cname) {
puts("reverse for " + a + ": " + JSON.stringify(domains)); puts("reverse for " + a + ": " + JSON.stringify(domains));
}); });
reversing.addErrback( function (code, msg) { reversing.addErrback( function (e) {
puts("reverse for " + a + " failed: " + msg); puts("reverse for " + a + " failed: " + e.message);
}); });
} }
}); });
resolution.addErrback(function (code, msg) { resolution.addErrback(function (e) {
puts("error: " + msg); puts("error: " + e.message);
}); });
------------------------------------------------------------------------- -------------------------------------------------------------------------


Expand All @@ -1430,8 +1430,9 @@ This function returns a promise.
- on success: returns +addresses, ttl, cname+. +ttl+ (time-to-live) is an integer - on success: returns +addresses, ttl, cname+. +ttl+ (time-to-live) is an integer
specifying the number of seconds this result is valid for. +cname+ is the specifying the number of seconds this result is valid for. +cname+ is the
canonical name for the query. canonical name for the query.
- on error: returns +code, msg+. +code+ is one of the error codes listed - on error: Returns an instanceof Error object, where the "errno" field is one
below and +msg+ is a string describing the error in English. of the error codes listed below and the "message" field is a string
describing the error in English.


+dns.resolve6(domain)+:: +dns.resolve6(domain)+::


Expand All @@ -1444,8 +1445,9 @@ Reverse resolves an ip address to an array of domain names.
- on success: returns +domains, ttl, cname+. +ttl+ (time-to-live) is an integer - on success: returns +domains, ttl, cname+. +ttl+ (time-to-live) is an integer
specifying the number of seconds this result is valid for. +cname+ is the specifying the number of seconds this result is valid for. +cname+ is the
canonical name for the query. +domains+ is an array of domains. canonical name for the query. +domains+ is an array of domains.
- on error: returns +code, msg+. +code+ is one of the error codes listed - on error: Returns an instanceof Error object, where the "errno" field is one
below and +msg+ is a string describing the error in English. of the error codes listed below and the "message" field is a string
describing the error in English.




Each DNS query can return an error code. Each DNS query can return an error code.
Expand Down

0 comments on commit bd4f56c

Please sign in to comment.