Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
jafermarq committed Apr 2, 2024
1 parent 6bf85db commit 7c146cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/py/flwr/client/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,10 @@ def _load_client_app() -> ClientApp:
# Execute ClientApp
reply_message = client_app(message=message, context=context)
except Exception as ex: # pylint: disable=broad-exception-caught
log(ERROR, "SuperNode raised an exception", exc_info=ex)

# Legacy grpc-bidi
if transport in ["grpc-bidi", None]:
log(ERROR, "Client raised an exception.", exc_info=ex)
# Raise exception, crash process
raise ex

Expand All @@ -507,12 +507,16 @@ def _load_client_app() -> ClientApp:
e_code = ErrorCode.CLIENT_APP_RAISED_EXCEPTION
# Reason example: "<class 'ZeroDivisionError'>:<'division by zero'>"
reason = str(type(ex)) + ":<'" + str(ex) + "'>"
exc_entity = "ClientApp"
if isinstance(ex, LoadClientAppError):
reason = (
"An exception was raised when attempting to load "
"the ClientApp module"
)
e_code = ErrorCode.LOAD_CLIENT_APP_EXCEPTION
exc_entity = "SuperNode"

log(ERROR, "%s raised an exception", exc_entity, exc_info=ex)

# Create error message
reply_message = message.create_error_reply(
Expand Down

0 comments on commit 7c146cd

Please sign in to comment.