Skip to content

exceptions

zeus.optimizer.batch_size.server.exceptions

Zeus server exceptions.

ZeusBSOServerBaseError

Bases: ZeusBaseError

Base error class for BSO server.

Source code in zeus/optimizer/batch_size/server/exceptions.py
 6
 7
 8
 9
10
11
12
class ZeusBSOServerBaseError(ZeusBaseError):
    """Base error class for BSO server."""

    def __init__(self, msg: str):
        """Set status code."""
        super().__init__(msg)
        self.status_code = 500

__init__

__init__(msg)
Source code in zeus/optimizer/batch_size/server/exceptions.py
 9
10
11
12
def __init__(self, msg: str):
    """Set status code."""
    super().__init__(msg)
    self.status_code = 500

ZeusBSOJobConfigMismatchError

Bases: ZeusBSOServerBaseError

When the job configuration doesn't align for the same job_id.

Source code in zeus/optimizer/batch_size/server/exceptions.py
15
16
17
18
19
20
21
class ZeusBSOJobConfigMismatchError(ZeusBSOServerBaseError):
    """When the job configuration doesn't align for the same job_id."""

    def __init__(self, msg: str):
        """Set status code."""
        super().__init__(msg)
        self.status_code = 409

__init__

__init__(msg)
Source code in zeus/optimizer/batch_size/server/exceptions.py
18
19
20
21
def __init__(self, msg: str):
    """Set status code."""
    super().__init__(msg)
    self.status_code = 409

ZeusBSOValueError

Bases: ZeusBSOServerBaseError

When the certain value is invalid.

Source code in zeus/optimizer/batch_size/server/exceptions.py
24
25
26
27
28
29
30
class ZeusBSOValueError(ZeusBSOServerBaseError):
    """When the certain value is invalid."""

    def __init__(self, msg: str):
        """Set status code."""
        super().__init__(msg)
        self.status_code = 400

__init__

__init__(msg)
Source code in zeus/optimizer/batch_size/server/exceptions.py
27
28
29
30
def __init__(self, msg: str):
    """Set status code."""
    super().__init__(msg)
    self.status_code = 400

ZeusBSOServerNotFoundError

Bases: ZeusBSOServerBaseError

Resource we are looking for is not found.

Source code in zeus/optimizer/batch_size/server/exceptions.py
33
34
35
36
37
38
39
class ZeusBSOServerNotFoundError(ZeusBSOServerBaseError):
    """Resource we are looking for is not found."""

    def __init__(self, msg: str):
        """Set status code."""
        super().__init__(msg)
        self.status_code = 404

__init__

__init__(msg)
Source code in zeus/optimizer/batch_size/server/exceptions.py
36
37
38
39
def __init__(self, msg: str):
    """Set status code."""
    super().__init__(msg)
    self.status_code = 404

ZeusBSOServiceBadOperationError

Bases: ZeusBSOServerBaseError

When the operation doesn't meet requirements. ex) fetching measurements before fetching a job.

Source code in zeus/optimizer/batch_size/server/exceptions.py
42
43
44
45
46
47
48
class ZeusBSOServiceBadOperationError(ZeusBSOServerBaseError):
    """When the operation doesn't meet requirements. ex) fetching measurements before fetching a job."""

    def __init__(self, msg: str):
        """Set status code."""
        super().__init__(msg)
        self.status_code = 400

__init__

__init__(msg)
Source code in zeus/optimizer/batch_size/server/exceptions.py
45
46
47
48
def __init__(self, msg: str):
    """Set status code."""
    super().__init__(msg)
    self.status_code = 400

ZeusBSOServerRuntimeError

Bases: ZeusBSOServerBaseError

Initialization or other errors during runtime.

Source code in zeus/optimizer/batch_size/server/exceptions.py
51
52
53
54
55
56
57
class ZeusBSOServerRuntimeError(ZeusBSOServerBaseError):
    """Initialization or other errors during runtime."""

    def __init__(self, msg: str):
        """Set status code."""
        super().__init__(msg)
        self.status_code = 500

__init__

__init__(msg)
Source code in zeus/optimizer/batch_size/server/exceptions.py
54
55
56
57
def __init__(self, msg: str):
    """Set status code."""
    super().__init__(msg)
    self.status_code = 500