Skip to content

client.exceptions

Classes:

Name Description
CommunicationException

Server communication exception base class.

MetricsUploadException

Global model metrics upload (to the server) exception.

ModelDownloadException

Global model download (from the server) exception.

ModelUploadException

Local model upload (to the server) exception.

Classes

CommunicationException

Bases: Exception


              flowchart TD
              client.exceptions.CommunicationException[CommunicationException]

              

              click client.exceptions.CommunicationException href "" "client.exceptions.CommunicationException"
            

Server communication exception base class.

Methods:

Name Description
__init__

Create a new communication exception.

Attributes:

Name Type Description
response
Source code in dlr/fl/client/exceptions.py
class CommunicationException(Exception):
    """
    Server communication exception base class.
    """
    def __init__(self, response: Response, *args, **kwargs) -> None:
        """
        Create a new communication exception.

        Args:
            response (Response): http response from the server
        """
        message = "Something really went wrong with the server response!"
        try:
            message = response.text
            message = json.loads(message)["message"]
        except Exception:
            pass
        super().__init__(message, *args, **kwargs)
        self.response = response

Attributes

response instance-attribute
response = response

Functions

__init__
__init__(response: Response, *args, **kwargs) -> None

Create a new communication exception.

Parameters:

Name Type Description Default
response
Response

http response from the server

required
Source code in dlr/fl/client/exceptions.py
def __init__(self, response: Response, *args, **kwargs) -> None:
    """
    Create a new communication exception.

    Args:
        response (Response): http response from the server
    """
    message = "Something really went wrong with the server response!"
    try:
        message = response.text
        message = json.loads(message)["message"]
    except Exception:
        pass
    super().__init__(message, *args, **kwargs)
    self.response = response

MetricsUploadException

Bases: CommunicationException


              flowchart TD
              client.exceptions.MetricsUploadException[MetricsUploadException]
              client.exceptions.CommunicationException[CommunicationException]

                              client.exceptions.CommunicationException --> client.exceptions.MetricsUploadException
                


              click client.exceptions.MetricsUploadException href "" "client.exceptions.MetricsUploadException"
              click client.exceptions.CommunicationException href "" "client.exceptions.CommunicationException"
            

Global model metrics upload (to the server) exception.

Source code in dlr/fl/client/exceptions.py
class MetricsUploadException(CommunicationException):
    """Global model metrics upload (to the server) exception."""
    pass

ModelDownloadException

Bases: CommunicationException


              flowchart TD
              client.exceptions.ModelDownloadException[ModelDownloadException]
              client.exceptions.CommunicationException[CommunicationException]

                              client.exceptions.CommunicationException --> client.exceptions.ModelDownloadException
                


              click client.exceptions.ModelDownloadException href "" "client.exceptions.ModelDownloadException"
              click client.exceptions.CommunicationException href "" "client.exceptions.CommunicationException"
            

Global model download (from the server) exception.

Source code in dlr/fl/client/exceptions.py
class ModelDownloadException(CommunicationException):
    """Global model download (from the server) exception."""
    pass

ModelUploadException

Bases: CommunicationException


              flowchart TD
              client.exceptions.ModelUploadException[ModelUploadException]
              client.exceptions.CommunicationException[CommunicationException]

                              client.exceptions.CommunicationException --> client.exceptions.ModelUploadException
                


              click client.exceptions.ModelUploadException href "" "client.exceptions.ModelUploadException"
              click client.exceptions.CommunicationException href "" "client.exceptions.CommunicationException"
            

Local model upload (to the server) exception.

Source code in dlr/fl/client/exceptions.py
class ModelUploadException(CommunicationException):
    """Local model upload (to the server) exception."""
    pass