Source code for camacq.exceptions

"""Provide exceptions."""


[docs] class CamAcqError(Exception): """Represent the base camacq exception."""
[docs] class MissingActionTypeError(CamAcqError): """Represent a missing action type error.""" def __init__(self, action_type: str) -> None: """Set up the error.""" super().__init__(f"No such action type registered: {action_type}")
[docs] class MissingActionError(CamAcqError): """Represent a missing action error.""" def __init__(self, action_id: str) -> None: """Set up the error.""" super().__init__(f"No such action id registered: {action_id}")
[docs] class SampleError(CamAcqError): """Represent a sample error."""
[docs] class TemplateError(CamAcqError): """Represent a template error.""" def __init__(self, exc: Exception) -> None: """Set up the error.""" super().__init__(f"{exc.__class__.__name__}: {exc}")