Zeroname-local - Added better error messages in case namecoin domain lookup fails
This commit is contained in:
parent
64981e4392
commit
4b96a63195
1 changed files with 5 additions and 3 deletions
|
@ -19,18 +19,20 @@ def lookupDomain(domain):
|
|||
|
||||
try:
|
||||
domain_object = rpc.name_show("d/"+domain)
|
||||
except:
|
||||
except Exception, err:
|
||||
#domain doesn't exist
|
||||
print "Error looking up domain - does not exist %s %s" % (domain,err)
|
||||
return None
|
||||
|
||||
domain_json = json.loads(domain_object['value'])
|
||||
|
||||
try:
|
||||
domain_address = domain_json["zeronet"][subdomain]
|
||||
except:
|
||||
except Exception, err:
|
||||
#domain exists but doesn't have any zeronet value
|
||||
print "Error looking up domain - doesn't contain zeronet value %s %s" % (domain,err)
|
||||
return None
|
||||
|
||||
|
||||
return domain_address
|
||||
|
||||
# Loading config...
|
||||
|
|
Loading…
Reference in a new issue