getdns will throw an exception, getdns.error, under certain conditions. Those conditions include:
Please note that a successful return from a getdns method does not indicate that the query returned the records being requested, but rather that the query is formed correctly and has been submitted to the DNS. A getdns exception is typically the result of a coding error.
getdns will set the exception message to a diagnostic string, which may be examined for help in resolving the error.
import getdns, sys
c = getdns.Context()
try:
results = c.address('www.example.com', foo='bar')
except getdns.error, e:
print(str(e))
sys.exit(1)
This will result in “A required parameter had an invalid value” being printed to the screen.