What are the best practices for creating exceptions? I just saw this, and I don\'t know if I should be horrified, or like it. I read several times in books that exceptions shoul
class Error(Exception):
"""Base class for other exceptions"""
pass
class empty_string_error(Error):
"""Raised when the input value is too large"""
pass
while(1):
try:
if("Your Condition"):
raise empty_string_error
else:
print("OUTPUT")
except empty_string_error:
print("APT MESSAGE")
print(" ")
finally:
pint("Mandatory code")