Loading src/common/error_codes.py +3 −5 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ from dataclasses import dataclass @dataclass class ErrorCodes: # Database Errors DB_CONNECTION_FAILED: int = 1001 DB_TIMEOUT: int = 1002 DB_INTEGRITY_ERROR: int = 1003 Loading @@ -18,9 +20,5 @@ class ErrorCodes: TEMPLATE_NOT_FOUND: int = 3002 TEMPLATE_SYNTAX_ERROR: int = 3003 # Catch all Error DEFAULT_ERROR: int = 9999 def handle_error(): error_codes = ErrorCodes() print(f"Database connection failed error code: {error_codes.DB_CONNECTION_FAILED}") src/common/exceptions.py +0 −14 Original line number Diff line number Diff line Loading @@ -58,17 +58,3 @@ class TemplateException(CommonException): class ParserError(ScraperException): def __init__(self, message=None): super().__init__(message, 2003) if __name__ == "__main__": try: raise TemplateException("Template Connection Failed", 3001) except TemplateException as e: print(e) print(f"{e!r}") try: raise TemplateException("Template Connection Failed", 30001) except TemplateException as e: print(e) print(f"{e!r}") Loading
src/common/error_codes.py +3 −5 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ from dataclasses import dataclass @dataclass class ErrorCodes: # Database Errors DB_CONNECTION_FAILED: int = 1001 DB_TIMEOUT: int = 1002 DB_INTEGRITY_ERROR: int = 1003 Loading @@ -18,9 +20,5 @@ class ErrorCodes: TEMPLATE_NOT_FOUND: int = 3002 TEMPLATE_SYNTAX_ERROR: int = 3003 # Catch all Error DEFAULT_ERROR: int = 9999 def handle_error(): error_codes = ErrorCodes() print(f"Database connection failed error code: {error_codes.DB_CONNECTION_FAILED}")
src/common/exceptions.py +0 −14 Original line number Diff line number Diff line Loading @@ -58,17 +58,3 @@ class TemplateException(CommonException): class ParserError(ScraperException): def __init__(self, message=None): super().__init__(message, 2003) if __name__ == "__main__": try: raise TemplateException("Template Connection Failed", 3001) except TemplateException as e: print(e) print(f"{e!r}") try: raise TemplateException("Template Connection Failed", 30001) except TemplateException as e: print(e) print(f"{e!r}")