Skip to content

exceptions

CreatorError

Bases: Exception

Should be raised when creator failed because of known issue.

Message of error should be artist friendly.

Source code in client/ayon_core/pipeline/create/exceptions.py
63
64
65
66
67
68
class CreatorError(Exception):
    """Should be raised when creator failed because of known issue.

    Message of error should be artist friendly.
    """
    pass

CreatorsOperationFailed

Bases: Exception

Raised when a creator process crashes in 'CreateContext'.

The exception contains information about the creator and error. The data are prepared using 'prepare_failed_creator_operation_info' and can be serialized using json.

Usage is for UI purposes which may not have access to exceptions directly and would not have ability to catch exceptions 'per creator'.

Parameters:

Name Type Description Default
msg str

General error message.

required
failed_info list[dict[str, Any]]

List of failed creators with exception message and optionally formatted traceback.

required
Source code in client/ayon_core/pipeline/create/exceptions.py
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
class CreatorsOperationFailed(Exception):
    """Raised when a creator process crashes in 'CreateContext'.

    The exception contains information about the creator and error. The data
    are prepared using 'prepare_failed_creator_operation_info' and can be
    serialized using json.

    Usage is for UI purposes which may not have access to exceptions directly
    and would not have ability to catch exceptions 'per creator'.

    Args:
        msg (str): General error message.
        failed_info (list[dict[str, Any]]): List of failed creators with
            exception message and optionally formatted traceback.
    """

    def __init__(self, msg, failed_info):
        super().__init__(msg)
        self.failed_info = failed_info

HostMissRequiredMethod

Bases: Exception

Host does not have implemented required functions for creation.

Source code in client/ayon_core/pipeline/create/exceptions.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class HostMissRequiredMethod(Exception):
    """Host does not have implemented required functions for creation."""

    def __init__(self, host, missing_methods):
        self.missing_methods = missing_methods
        self.host = host
        joined_methods = ", ".join(
            ['"{}"'.format(name) for name in missing_methods]
        )
        dirpath = os.path.dirname(
            os.path.normpath(inspect.getsourcefile(host))
        )
        dirpath_parts = dirpath.split(os.path.sep)
        host_name = dirpath_parts.pop(-1)
        if host_name == "api":
            host_name = dirpath_parts.pop(-1)

        msg = "Host \"{}\" does not have implemented method/s {}".format(
            host_name, joined_methods
        )
        super().__init__(msg)

ImmutableKeyError

Bases: TypeError

Accessed key is immutable so does not allow changes or removals.

Source code in client/ayon_core/pipeline/create/exceptions.py
10
11
12
13
14
15
16
17
18
19
class ImmutableKeyError(TypeError):
    """Accessed key is immutable so does not allow changes or removals."""

    def __init__(self, key, msg=None):
        self.immutable_key = key
        if not msg:
            msg = "Key \"{}\" is immutable and does not allow changes.".format(
                key
            )
        super().__init__(msg)

UnavailableSharedData

Bases: Exception

Shared data are not available at the moment when are accessed.

Source code in client/ayon_core/pipeline/create/exceptions.py
5
6
7
class UnavailableSharedData(Exception):
    """Shared data are not available at the moment when are accessed."""
    pass