Source Code:
(back to article)
class MyCustomException(Exception): def __init__(self, message): self.message = message try: raise MyCustomException("An error occurred") except Exception as e: print(e)
Result:
Report an issue