Python - Custom Exceptions
What will be the output of this code?
class MyError(Exception):
def __str__(self):
return 'Custom error occurred'
try:
raise MyError()
except MyError as e:
print(e)