getdns icon indicating copy to clipboard operation
getdns copied to clipboard

Consider adding an error response dict

Open glenwiley opened this issue 11 years ago • 5 comments

We should probably return a negative response dictionary for errors. It would be nice if the callback received at least the name being queried. (#108 from private repo)

glenwiley avatar Feb 26 '14 20:02 glenwiley

At least for timeouts this is now actually specified:

quoting from 1.5:

The following are the values for callback_type.

GETDNS_CALLBACK_COMPLETE

The response has the requested data in it

GETDNS_CALLBACK_CANCEL

The calling program cancelled the callback; response is NULL

GETDNS_CALLBACK_TIMEOUT

The requested action timed out; response is filled in with empty structures

GETDNS_CALLBACK_ERROR

The requested action had an error; response is NULL

wtoorop avatar Jun 30 '14 11:06 wtoorop

Willem: that's an incorrect reading of the spec. A negative response should get GETDNS_CALLBACK_COMPLETE. It is not an error, it is a response.

paulehoffman avatar Jul 01 '14 00:07 paulehoffman

Changed title to more clearly convey the intent here. The suggested response dict is not for NXDOMAIN's but to provide more detailed error reporting. If we return a response with empty structures with GETDNS_CALLBACK_CANCEL and GETDNS_CALLBACK_ERROR, like we do with GETDNS_CALLBACK_TIMEOUT, then more detailed error reporting can be embedded therein.

wtoorop avatar Dec 21 '15 08:12 wtoorop

We should note that this changes the fact that the user can currently ignore the response dict (and is not responsible for freeing it). So this is actually a major API change.

saradickinson avatar Sep 06 '17 14:09 saradickinson

I fully agree with Sara about this being a major API change.

paulehoffman avatar Sep 06 '17 16:09 paulehoffman