Source code for compass.exceptions

"""Custom Exceptions and Errors for COMPASS"""

import logging


logger = logging.getLogger("compass")


[docs] class COMPASSError(Exception): """Generic COMPASS Error""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if args: logger.error( "<%s> %s", self.__class__.__name__, args[0], stacklevel=2 )
[docs] class COMPASSNotInitializedError(COMPASSError): """COMPASS not initialized error"""
[docs] class COMPASSValueError(COMPASSError, ValueError): """COMPASS ValueError"""
[docs] class COMPASSRuntimeError(COMPASSError, RuntimeError): """COMPASS RuntimeError"""