# Try to apply patches to find matches for any unmatched residues.
ifmatchesisNone:
# Something went wrong because the generated template does not match the residue signature.
iflen(unmatchedResidues)>0:
raiseException('The residue handler %s indicated it had correctly parameterized residue %s, but the generated template did not match the residue signature.'%(generator.__class__.__name__,str(res)))
# Something went wrong because the generated template does not match the residue signature.
raiseException('The residue handler %s indicated it had correctly parameterized residue %s, but the generated template did not match the residue signature.'%(generator.__class__.__name__,str(res)))
else:
# We successfully generated a residue template. Break out of the for loop.
break
ifmatchesisNone:
raiseValueError('No template found for residue %d (%s). %s'%(res.index+1,res.name,_findMatchErrors(self,res)))