Skip to content

exceptions

drunc.fsm.exceptions

Classes

DoubleArgument(txt)

Bases: FSMException

Raised when an argument is provided more than once

Source code in drunc/fsm/exceptions.py
def __init__(self, txt):
    self.message = txt
    super().__init__(self.message)

DuplicateTransition(transition_name)

Bases: FSMException

If a transition has the same name as another

Source code in drunc/fsm/exceptions.py
def __init__(self, transition_name):
    self.message = f'Transition "{transition_name}" is a duplicate'
    super().__init__(self.message)

InvalidAction(iface)

Bases: FSMException

Raised when an action doesn't have pre/post transitions

Source code in drunc/fsm/exceptions.py
def __init__(self, iface):
    self.message = (
        f'The action "{iface}" does not have any pre or post transition method'
    )
    super().__init__(self.message)

InvalidActionMethod(iface, method)

Bases: FSMException

Raised when an action doesn't have the pre/post transitions arguments

Source code in drunc/fsm/exceptions.py
def __init__(self, iface, method):
    self.message = f'The action "{iface}" method {method} does not have the correct arguements, each one should have at least "_input_data" and "**kwargs", and have type annotations'
    super().__init__(self.message)

InvalidTransition(transition, state)

Bases: FSMException

Raised when the transition isn't in the list of currently accessible transitions

Source code in drunc/fsm/exceptions.py
def __init__(self, transition, state):
    self.message = f"Transition {transition} is not allowed from the state {state}."
    super().__init__(self.message)

MissingArgument(param, name)

Bases: FSMException

Raised when a mandatory argument is not provided for a transition

Source code in drunc/fsm/exceptions.py
def __init__(self, param, name):
    self.message = f'The mandatory argument "{param}" was not provided to the transition {name}'
    super().__init__(self.message)

MissingArgumentValue()

Bases: FSMException

Raised when a mandatory argument is not provided for a transition

Source code in drunc/fsm/exceptions.py
def __init__(self):
    self.message = "A passed argument does not have an associated value, arguments are key-value pairs."
    super().__init__(self.message)

UnknownAction(name)

Bases: FSMException

Raised when a plugin name is provided that does not correspond to any files in /plugins

Source code in drunc/fsm/exceptions.py
def __init__(self, name):
    self.message = f'"{name}" is not a known plugin.'
    super().__init__(self.message)

UnknownArgument(param, name)

Bases: FSMException

Raised when an unwanted argument is given to a transition

Source code in drunc/fsm/exceptions.py
def __init__(self, param, name):
    self.message = (
        f'The mandatory argument "{param}" is not required by transition {name}'
    )
    super().__init__(self.message)

UnregisteredTransition(transition)

Bases: FSMException

Raised when the transition is allowed, but we can't find the implementation

Source code in drunc/fsm/exceptions.py
def __init__(self, transition):
    self.message = f"Implementation of {transition} not found."
    super().__init__(self.message)