Skip to content

Commit 3af57b6

Browse files
fix: exceptions
1 parent b243dc3 commit 3af57b6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
from common_library.errors_classes import OsparcErrorMixin
1+
from common_library.user_messages import user_message
22

3+
from ..errors import WebServerBaseError
34

4-
class FunctionGroupAccessRightsNotFoundError(OsparcErrorMixin, Exception):
5-
msg_template = "Group access rights not found for {object_type} '{object_id}' in product '{product_name}'"
5+
6+
class FunctionGroupAccessRightsNotFoundError(WebServerBaseError, RuntimeError):
7+
msg_template = user_message(
8+
"Group access rights could not be found for Function '{function_id}' in product '{product_name}'."
9+
)

services/web/server/src/simcore_service_webserver/functions/_functions_service.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,8 @@ async def list_function_group_permissions(
478478
return access_rights
479479

480480
raise FunctionGroupAccessRightsNotFoundError(
481+
function_id=function_id,
481482
product_name=product_name,
482-
object_id=function_id,
483-
object_type="function",
484483
)
485484

486485

@@ -509,8 +508,7 @@ async def set_function_group_permissions(
509508

510509
raise FunctionGroupAccessRightsNotFoundError(
511510
product_name=product_name,
512-
object_id=function_id,
513-
object_type="function",
511+
function_id=function_id,
514512
)
515513

516514

0 commit comments

Comments
 (0)