Skip to content

Commit f2113ec

Browse files
exeption handling
1 parent bc83eb0 commit f2113ec

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

services/web/server/src/simcore_service_webserver/licenses/_exceptions_handlers.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,16 @@
88
exception_handling_decorator,
99
to_exceptions_handlers_map,
1010
)
11-
from ..projects.exceptions import ProjectRunningConflictError, ProjectStoppingError
12-
from .errors import (
13-
WorkspaceAccessForbiddenError,
14-
WorkspaceGroupNotFoundError,
15-
WorkspaceNotFoundError,
16-
)
11+
from .errors import LicenseGoodNotFoundError
1712

1813
_logger = logging.getLogger(__name__)
1914

2015

2116
_TO_HTTP_ERROR_MAP: ExceptionToHttpErrorMap = {
22-
WorkspaceGroupNotFoundError: HttpErrorInfo(
23-
status.HTTP_404_NOT_FOUND,
24-
"Workspace {workspace_id} group {group_id} not found.",
25-
),
26-
WorkspaceAccessForbiddenError: HttpErrorInfo(
27-
status.HTTP_403_FORBIDDEN,
28-
"Does not have access to this workspace",
29-
),
30-
WorkspaceNotFoundError: HttpErrorInfo(
17+
LicenseGoodNotFoundError: HttpErrorInfo(
3118
status.HTTP_404_NOT_FOUND,
32-
"Workspace not found. {reason}",
33-
),
34-
# Trashing
35-
ProjectRunningConflictError: HttpErrorInfo(
36-
status.HTTP_409_CONFLICT,
37-
"One or more studies in this workspace are in use and cannot be trashed. Please stop all services first and try again",
38-
),
39-
ProjectStoppingError: HttpErrorInfo(
40-
status.HTTP_503_SERVICE_UNAVAILABLE,
41-
"Something went wrong while stopping running services in studies within this workspace before trashing. Aborting trash.",
42-
),
19+
"Market item {license_good_id} not found.",
20+
)
4321
}
4422

4523

0 commit comments

Comments
 (0)