Skip to content

exceptions

AnatomyTemplateUnsolved

Bases: TemplateUnsolved

Exception for unsolved template when strict is set to True.

Source code in client/ayon_core/pipeline/anatomy/exceptions.py
36
37
38
39
class AnatomyTemplateUnsolved(TemplateUnsolved):
    """Exception for unsolved template when strict is set to True."""

    msg = "Anatomy template \"{0}\" is unsolved.{1}{2}"

ProjectNotSet

Bases: Exception

Exception raised when is created Anatomy without project name.

Source code in client/ayon_core/pipeline/anatomy/exceptions.py
4
5
class ProjectNotSet(Exception):
    """Exception raised when is created Anatomy without project name."""

RootCombinationError

Bases: Exception

This exception is raised when templates has combined root types.

Source code in client/ayon_core/pipeline/anatomy/exceptions.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
class RootCombinationError(Exception):
    """This exception is raised when templates has combined root types."""

    def __init__(self, roots):
        joined_roots = ", ".join(
            ["\"{}\"".format(_root) for _root in roots]
        )
        # TODO better error message
        msg = (
            "Combination of root with and"
            " without root name in AnatomyTemplates. {}"
        ).format(joined_roots)

        super(RootCombinationError, self).__init__(msg)

TemplateMissingKey

Bases: Exception

Exception for cases when key does not exist in template.

Source code in client/ayon_core/pipeline/anatomy/exceptions.py
24
25
26
27
28
29
30
31
32
33
class TemplateMissingKey(Exception):
    """Exception for cases when key does not exist in template."""

    msg = "Template key '{}' was not found."

    def __init__(self, parents):
        parent_join = "".join(["[\"{0}\"]".format(key) for key in parents])
        super(TemplateMissingKey, self).__init__(
            self.msg.format(parent_join)
        )