From bd291c6424648a822c6449ac4e8b54efaa37230a Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Tue, 3 Jan 2023 17:37:34 +0000
Subject: [PATCH] Common:

- cosmetic changes in RPC method wrapper
---
 .../rpc_method_wrapper/ServiceExceptions.py    | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/common/rpc_method_wrapper/ServiceExceptions.py b/src/common/rpc_method_wrapper/ServiceExceptions.py
index e8d5c79ac..e516953c5 100644
--- a/src/common/rpc_method_wrapper/ServiceExceptions.py
+++ b/src/common/rpc_method_wrapper/ServiceExceptions.py
@@ -18,8 +18,7 @@ from typing import Iterable, Union
 class ServiceException(Exception):
     def __init__(
         self, code : grpc.StatusCode, details : str, extra_details : Union[str, Iterable[str]] = []
-        ) -> None:
-
+    ) -> None:
         self.code = code
         if isinstance(extra_details, str): extra_details = [extra_details]
         self.details = '; '.join(map(str, [details] + extra_details))
@@ -28,39 +27,34 @@ class ServiceException(Exception):
 class NotFoundException(ServiceException):
     def __init__(
         self, object_name : str, object_uuid: str, extra_details : Union[str, Iterable[str]] = []
-        ) -> None:
-
+    ) -> None:
         details = '{:s}({:s}) not found'.format(str(object_name), str(object_uuid))
         super().__init__(grpc.StatusCode.NOT_FOUND, details, extra_details=extra_details)
 
 class AlreadyExistsException(ServiceException):
     def __init__(
         self, object_name : str, object_uuid: str, extra_details : Union[str, Iterable[str]] = None
-        ) -> None:
-
+    ) -> None:
         details = '{:s}({:s}) already exists'.format(str(object_name), str(object_uuid))
         super().__init__(grpc.StatusCode.ALREADY_EXISTS, details, extra_details=extra_details)
 
 class InvalidArgumentException(ServiceException):
     def __init__(
         self, argument_name : str, argument_value: str, extra_details : Union[str, Iterable[str]] = None
-        ) -> None:
-
+    ) -> None:
         details = '{:s}({:s}) is invalid'.format(str(argument_name), str(argument_value))
         super().__init__(grpc.StatusCode.INVALID_ARGUMENT, details, extra_details=extra_details)
 
 class OperationFailedException(ServiceException):
     def __init__(
         self, operation : str, extra_details : Union[str, Iterable[str]] = None
-        ) -> None:
-
+    ) -> None:
         details = 'Operation({:s}) failed'.format(str(operation))
         super().__init__(grpc.StatusCode.INTERNAL, details, extra_details=extra_details)
 
 class NotImplementedException(ServiceException):
     def __init__(
         self, operation : str, extra_details : Union[str, Iterable[str]] = None
-        ) -> None:
-
+    ) -> None:
         details = 'Operation({:s}) not implemented'.format(str(operation))
         super().__init__(grpc.StatusCode.UNIMPLEMENTED, details, extra_details=extra_details)
-- 
GitLab