Skip to content

fl_server_ai.exceptions

Classes:

Name Description
AggregationException

Exception raised for errors in the aggregation process.

ClientNotificationRejectionException

Exception raised when a client rejects a notification.

NotificationException

Exception raised for errors in the notification process.

Classes

AggregationException

Bases: Exception


              flowchart TD
              fl_server_ai.exceptions.AggregationException[AggregationException]

              

              click fl_server_ai.exceptions.AggregationException href "" "fl_server_ai.exceptions.AggregationException"
            

Exception raised for errors in the aggregation process.

This is a custom exception class that should be raised when there is an error during the aggregation process.

Source code in fl_server_ai/exceptions.py
class AggregationException(Exception):
    """
    Exception raised for errors in the aggregation process.

    This is a custom exception class that should be raised when there is an error during the aggregation process.
    """
    pass

ClientNotificationRejectionException

Bases: NotificationException


              flowchart TD
              fl_server_ai.exceptions.ClientNotificationRejectionException[ClientNotificationRejectionException]
              fl_server_ai.exceptions.NotificationException[NotificationException]

                              fl_server_ai.exceptions.NotificationException --> fl_server_ai.exceptions.ClientNotificationRejectionException
                


              click fl_server_ai.exceptions.ClientNotificationRejectionException href "" "fl_server_ai.exceptions.ClientNotificationRejectionException"
              click fl_server_ai.exceptions.NotificationException href "" "fl_server_ai.exceptions.NotificationException"
            

Exception raised when a client rejects a notification.

This is a custom exception class that should be raised when a client rejects a notification. It inherits from NotificationException and adds additional attributes related to the client's response.

Methods:

Name Description
__init__

Attributes:

Name Type Description
response

The client's response to the notification.

status_code

The HTTP status code of the client's response.

Source code in fl_server_ai/exceptions.py
class ClientNotificationRejectionException(NotificationException):
    """
    Exception raised when a client rejects a notification.

    This is a custom exception class that should be raised when a client rejects a notification.
    It inherits from NotificationException and adds additional attributes related to the client's response.
    """

    def __init__(self, response: Response, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.response = response
        """The client's response to the notification."""
        self.status_code = response.status_code
        """The HTTP status code of the client's response."""

Attributes

response instance-attribute
response = response

The client's response to the notification.

status_code instance-attribute
status_code = status_code

The HTTP status code of the client's response.

Functions

__init__
__init__(response: Response, *args, **kwargs)
Source code in fl_server_ai/exceptions.py
def __init__(self, response: Response, *args, **kwargs):
    super().__init__(*args, **kwargs)
    self.response = response
    """The client's response to the notification."""
    self.status_code = response.status_code
    """The HTTP status code of the client's response."""

NotificationException

Bases: Exception


              flowchart TD
              fl_server_ai.exceptions.NotificationException[NotificationException]

              

              click fl_server_ai.exceptions.NotificationException href "" "fl_server_ai.exceptions.NotificationException"
            

Exception raised for errors in the notification process.

This is a custom exception class that should be raised when there is an error during the notification process.

Methods:

Name Description
__init__

Attributes:

Name Type Description
endpoint_url

The URL of the endpoint that the notification was sent to.

inner_exception

The original exception that caused the notification error.

json_data

The JSON data that was sent in the notification.

max_retries

The maximum number of times to retry the notification.

notification_return_object

The object to return if the notification fails.

Source code in fl_server_ai/exceptions.py
class NotificationException(Exception):
    """
    Exception raised for errors in the notification process.

    This is a custom exception class that should be raised when there is an error during the notification process.
    """

    def __init__(
        self,
        endpoint_url: str,
        json_data: Any,
        max_retries: int,
        return_obj: Any = None,
        inner_exception: Optional[Exception] = None,
        *args,
        **kwargs
    ):
        super().__init__(*args, **kwargs)
        self.endpoint_url = endpoint_url
        """The URL of the endpoint that the notification was sent to."""
        self.json_data = json_data
        """The JSON data that was sent in the notification."""
        self.max_retries = max_retries
        """The maximum number of times to retry the notification."""
        self.notification_return_object = return_obj
        """The object to return if the notification fails."""
        self.inner_exception = inner_exception
        """The original exception that caused the notification error."""

Attributes

endpoint_url instance-attribute
endpoint_url = endpoint_url

The URL of the endpoint that the notification was sent to.

inner_exception instance-attribute
inner_exception = inner_exception

The original exception that caused the notification error.

json_data instance-attribute
json_data = json_data

The JSON data that was sent in the notification.

max_retries instance-attribute
max_retries = max_retries

The maximum number of times to retry the notification.

notification_return_object instance-attribute
notification_return_object = return_obj

The object to return if the notification fails.

Functions

__init__
__init__(endpoint_url: str, json_data: Any, max_retries: int, return_obj: Any = None, inner_exception: Exception | None = None, *args, **kwargs)
Source code in fl_server_ai/exceptions.py
def __init__(
    self,
    endpoint_url: str,
    json_data: Any,
    max_retries: int,
    return_obj: Any = None,
    inner_exception: Optional[Exception] = None,
    *args,
    **kwargs
):
    super().__init__(*args, **kwargs)
    self.endpoint_url = endpoint_url
    """The URL of the endpoint that the notification was sent to."""
    self.json_data = json_data
    """The JSON data that was sent in the notification."""
    self.max_retries = max_retries
    """The maximum number of times to retry the notification."""
    self.notification_return_object = return_obj
    """The object to return if the notification fails."""
    self.inner_exception = inner_exception
    """The original exception that caused the notification error."""