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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Responses (2)