Zeroname-local - Added better error messages in case namecoin domain lookup fails

This commit is contained in:
Idealcoder 2015-06-18 19:51:29 +01:00
parent 64981e4392
commit 4b96a63195
1 changed files with 5 additions and 3 deletions

View File

@ -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...