Jonathan Hsu
1 min readFeb 18, 2020

--

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!!

--

--