From ab85130b5b474566ab30b2e992fd998ce3d1c2b6 Mon Sep 17 00:00:00 2001 From: jafermarq Date: Mon, 1 Apr 2024 12:03:47 +0200 Subject: [PATCH] basic errorcodes --- src/py/flwr/common/constant.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/py/flwr/common/constant.py b/src/py/flwr/common/constant.py index 7d30a10f5881..65a523933e91 100644 --- a/src/py/flwr/common/constant.py +++ b/src/py/flwr/common/constant.py @@ -68,3 +68,15 @@ class SType: def __new__(cls) -> SType: """Prevent instantiation.""" raise TypeError(f"{cls.__name__} cannot be instantiated.") + + +class ErrorCode: + """Error codes for Message's Error.""" + + UNKNOWN = 0 + CLIENT_APP_FAILED_TO_LOAD = 1 + CLIENT_APP_RAISED_EXCEPTION = 2 + + def __new__(cls) -> ErrorCode: + """Prevent instantiation.""" + raise TypeError(f"{cls.__name__} cannot be instantiated.")