Concepts

Errors

Define and raise errors in your connector.

Execution Errors

An execution error can be defined or undefined. Depending on the type of execution error, the execution error class inherits from the respective predefined sila error class "sila.DefinedExecutionError" or "sila.UndefinedExecutionError". The description of the execution error is passed via the docstring of the execution error class.

class UnimplementedFeature(sila.DefinedExecutionError):
    """
    The Feature specified by the given Feature identifier is not implemented by the server.
    """

Execution errors that can be raised are passed to the affected method using the decorator parameter "errors". A list of defined execution errors is passed.

@sila.UnobservableProperty(errors=[UnimplementedFeature])

Copyright © 2024