Created
June 22, 2023 20:31
-
-
Save koss822/c82bf23efef008956956d9ad63545919 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExtendedException(Exception): | |
"""This exception extends functionality""" | |
error_message = None | |
error_code = None | |
def __init__(self, error_message = None, error_code = None): | |
self.error_message = error_message | |
self.error_code = error_code | |
try: | |
raise ExtendedException("This is error", 400) | |
except ExtendedException as e: | |
print(f"Error message: {e.error_message}, Error code: {e.error_code}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment