Skip to content

Commit

Permalink
+docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jafermarq committed Jan 8, 2025
1 parent fc6e17f commit cb7806f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/py/flwr/server/superlink/driver/serverappio_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,25 @@ def GetRunStatus(


def _raise_if(validation_error: bool, detail: str) -> None:

"""Raise a `ValueError` with a detailed message if a validation error occurs.
This function checks the given `validation_error` flag. If `True`, it raises
a `ValueError` with a message that includes the name of the function that
called `_raise_if` and the provided `detail`.
Parameters
----------
validation_error : bool
A flag indicating whether a validation error occurred.
detail : str
A detailed message describing the validation error.
Raises
------
ValueError
If `validation_error` is `True`, with a message in the format
"Malformed <CallerFunctionName>Request: <detail>".
"""
if validation_error:
caller_frame = inspect.currentframe()

Expand Down

0 comments on commit cb7806f

Please sign in to comment.