Hey Martin,

My recommendation for a human readable error would be to build the if logic needed to identify the specific error within your except block. For example, you could change the overall structure of the block to something like:

while True:
try:
# stuff
except Exception as e:
if condition_1:
print("The input was invalid because...")
else:
print("General catch-all message")

Or you could parse out different exceptions and handle each individually.

while True:
try:
# stuff
except TypeError as e:
# handle data type exceptions
except Exception as e:
# handle any other exception

Hope this helps, thanks for the support!!

Written by

Top writer with 1M+ views. Follow me at medium.com/code-85 and medium.com/growth-85

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store