[docs]classFlowItemValidationError(Exception):"""Exception raised when a flow item value fails validation."""def__init__(self,message:str):self.message=messagesuper().__init__(f"Validation failed: {message}")
[docs]classInvalidOperationError(Exception):"""Exception raised when an invalid operation is performed."""def__init__(self,message:str="Invalid operation performed."):self.message=messagesuper().__init__(self.message)
[docs]classMissingDependencyError(Exception):"""Exception raised when a dependency is missing."""def__init__(self,dependency:str):self.dependency=dependencysuper().__init__(f"Dependency '{dependency}' is missing. Please install it.")
[docs]classNetworkError(Exception):"""Exception raised when a flow key doesn't exist."""
[docs]classFileReadError(Exception):"""Exception raised when a file cannot be read."""
[docs]classMaxRetriesExceededError(Exception):"""Exception raised when the maximum number of retries is exceeded in exponential backoff."""def__init__(self,backoff_policy,total_time_slept:float):self._backoff_policy=backoff_policyself._total_time_slept=total_time_sleptsuper().__init__(f"""Backoff failed. Total time slept: {self._total_time_slept} seconds. Policy details: {str(self._backoff_policy)}""")
[docs]classMissingFlowKeyError(Exception):"""Exception raised when a flow key doesn't exist."""def__init__(self,key):self.key=keysuper().__init__(f"Flow key '{key}' doesn't exist. Please ensure that it's set in your flow.")
[docs]classMissingCacheKeyError(Exception):"""Exception raised when a cache key doesn't exist."""def__init__(self,key):self.key=keysuper().__init__(f"Cache key '{key}' not found in cache.")
[docs]classMissingEnvironmentVariableError(Exception):"""Exception raised when an environment variable doesn't exist."""def__init__(self,key):self.key=keysuper().__init__(f"Environment variable '{key}' doesn't exist. Please ensure that it's set in your environment.")