I'd like to use a try/except statement for checking that a string consists of letters only. What is wrong with the following
class LetterError(Exception):
pass
name = ""
while name=="":
try:
x = re.match(r'[a-zA-Z]',(input("Please enter a name: ")))
raise LetterError
except LetterError :
print("Insert letters only")