File: errors.py

package info (click to toggle)
python-parsl 2025.01.13%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,072 kB
  • sloc: python: 23,817; makefile: 349; sh: 276; ansic: 45
file content (35 lines) | stat: -rw-r--r-- 1,066 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from parsl.errors import ParslError


class DeserializationError(ParslError):
    """Failure at the deserialization of results/exceptions from remote workers.
    """

    def __init__(self, reason: str) -> None:
        self.reason = reason

    def __str__(self) -> str:
        return f"Failed to deserialize objects. Reason: {self.reason}"


class SerializationError(ParslError):
    """Failure to serialize task objects.
    """

    def __init__(self, fname: str) -> None:
        self.fname = fname
        self.troubleshooting = "https://parsl.readthedocs.io/en/latest/faq.html#addressing-serializationerror"

    def __str__(self) -> str:
        return f"Failed to serialize objects for an invocation of function {self.fname}. Refer {self.troubleshooting}"


class DeserializerPluginError(ParslError):
    """Failure to dynamically load a deserializer plugin.
    """

    def __init__(self, header: bytes) -> None:
        self.header = header

    def __str__(self) -> str:
        return f"Failed to load deserializer plugin for header {self.header!r}"