Source code for ska_tango_base.faults

#
# This file is part of the SKA Tango Base project
#
# Distributed under the terms of the BSD 3-clause new license.
# See LICENSE.txt for more info.
"""General SKA Tango Device Exceptions."""

import jsonschema


[docs] class SKABaseError(Exception): """Base class for all SKA Tango Device exceptions."""
[docs] class GroupDefinitionsError(SKABaseError): """Error parsing or creating groups from GroupDefinitions."""
[docs] class LoggingLevelError(SKABaseError): """Error evaluating logging level."""
[docs] class LoggingTargetError(SKABaseError): """Error parsing logging target string."""
[docs] class RejectionError(SKABaseError): """Raise when execution of a command is rejected."""
[docs] class CmdNotAllowedError(RejectionError): """Raise from 'is_allowed' methods when a command is not allowed."""
[docs] class ValidateJSONArgsError(jsonschema.ValidationError, RejectionError): """Raise when 'validate_json_args' fails for any reason."""
[docs] class ResultCodeError(ValueError): """A method has returned an invalid return code."""
[docs] class StateModelError(ValueError): """Error in state machine model related to transitions or state."""
[docs] class CommandError(RuntimeError): """Error executing a BaseCommand or similar."""
[docs] class CapabilityValidationError(ValueError): """Error in validating capability input against capability types."""
[docs] class ComponentError(Exception): """Component cannot perform as requested."""
# TODO: This should really be named 'ComponentFaultError'
[docs] class ComponentFault(ComponentError): # noqa: N818 """Component is in FAULT state and cannot perform as requested."""