1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
from typing import List
class ParslError(Exception):
"""Base class for all exceptions.
Only to be invoked when a more specific error is not available.
"""
class ConfigurationError(ParslError):
"""Raised when a component receives an invalid configuration.
"""
class OptionalModuleMissing(ParslError):
''' Error raised when a required module is missing for a optional/extra component
'''
def __init__(self, module_names: List[str], reason: str):
self.module_names = module_names
self.reason = reason
def __str__(self) -> str:
return "The functionality requested requires optional modules {0} which could not be imported, because: {1}".format(
self.module_names, self.reason
)
class InternalConsistencyError(ParslError):
"""Raised when a component enounters an internal inconsistency.
"""
class NoDataFlowKernelError(ParslError):
"""Raised when no DataFlowKernel is available for an operation that needs one.
"""
|