This commit is contained in:
Mihaly Varadi 2019-11-01 13:52:48 +00:00
parent 7a60569631
commit a99fd6fd4e
2 changed files with 11 additions and 4 deletions

View file

@ -69,8 +69,15 @@ class ResidueIndexes(object):
"""
chain_id = chain_data["chain_label"]
url = "%s%s/chain/%s" % (self.api_url, self.pdb_id, chain_id)
response = requests.get(url)
residue_numbering = json.loads(response.text)
try:
response = requests.get(url)
except:
return False
try:
residue_numbering = json.loads(response.text)
except:
print("Failed to load residues from PDBe API")
return False
if not residue_numbering.keys():
self.mismatches.append("No residues in PDB for this entry - probably obsoleted entry")
return False