Skip to content

Commit f84ead9

Browse files
committed
updates proejcts
1 parent 5058bf7 commit f84ead9

File tree

4 files changed

+96
-37
lines changed

4 files changed

+96
-37
lines changed

services/web/server/src/simcore_service_webserver/catalog/_constants.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
MSG_CATALOG_SERVICE_UNAVAILABLE: Final[str] = user_message(
88
# Most likely the director service is down or misconfigured so the user is asked to try again later.
9-
"This service is temporarily unavailable. The incident was logged and will be investigated. "
10-
+ MSG_TRY_AGAIN_OR_SUPPORT
9+
"The catalog service is currently unavailable. This issue has been logged and will be investigated. "
10+
+ MSG_TRY_AGAIN_OR_SUPPORT,
11+
_version=1,
1112
)
1213

1314

services/web/server/src/simcore_service_webserver/invitations/errors.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66

77
from ..errors import WebServerBaseError
88

9-
MSG_INVALID_INVITATION_URL = user_message("Link seems corrupted or incomplete")
10-
MSG_INVITATION_ALREADY_USED = user_message("This invitation was already used")
9+
MSG_INVALID_INVITATION_URL = user_message(
10+
"The invitation link appears to be corrupted or incomplete.", _version=1
11+
)
12+
MSG_INVITATION_ALREADY_USED = user_message(
13+
"This invitation has already been used and cannot be used again.", _version=1
14+
)
1115

1216

1317
class InvitationsError(WebServerBaseError, ValueError): ...

services/web/server/src/simcore_service_webserver/payments/_onetime_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@
3838

3939

4040
MSG_WALLET_NO_ACCESS_ERROR = user_message(
41-
"User {user_id} does not have necessary permissions to do a payment into wallet {wallet_id}"
41+
"You do not have the necessary permissions to make payments to wallet {wallet_id}.",
42+
_version=1,
4243
)
44+
4345
_FAKE_PAYMENT_TRANSACTION_ID_PREFIX = "fpt"
4446

4547

services/web/server/src/simcore_service_webserver/projects/_controller/_rest_exceptions.py

Lines changed: 84 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -55,158 +55,210 @@
5555
_FOLDER_ERRORS: ExceptionToHttpErrorMap = {
5656
FolderAccessForbiddenError: HttpErrorInfo(
5757
status.HTTP_403_FORBIDDEN,
58-
user_message("Access to folder forbidden"),
58+
user_message("Access to this folder is forbidden.", _version=1),
5959
),
6060
FolderNotFoundError: HttpErrorInfo(
6161
status.HTTP_404_NOT_FOUND,
62-
user_message("Folder not found: {reason}"),
62+
user_message("The requested folder could not be found: {reason}", _version=1),
6363
),
6464
}
6565

6666

6767
_NODE_ERRORS: ExceptionToHttpErrorMap = {
6868
NodeNotFoundError: HttpErrorInfo(
6969
status.HTTP_404_NOT_FOUND,
70-
user_message("Node '{node_uuid}' not found in project '{project_uuid}'"),
70+
user_message(
71+
"Node '{node_uuid}' was not found in project '{project_uuid}'.", _version=1
72+
),
7173
),
7274
ParentNodeNotFoundError: HttpErrorInfo(
7375
status.HTTP_404_NOT_FOUND,
74-
user_message("Parent node '{node_uuid}' not found"),
76+
user_message("Parent node '{node_uuid}' was not found.", _version=1),
7577
),
7678
ProjectNodeRequiredInputsNotSetError: HttpErrorInfo(
7779
status.HTTP_409_CONFLICT,
78-
user_message("Project node is required but input is not set"),
80+
user_message(
81+
"Required input values for this project node have not been set.", _version=1
82+
),
7983
),
8084
}
8185

8286

8387
_PROJECT_ERRORS: ExceptionToHttpErrorMap = {
8488
ProjectDeleteError: HttpErrorInfo(
8589
status.HTTP_409_CONFLICT,
86-
"Failed to complete deletion of '{project_uuid}': {reason}",
90+
user_message(
91+
"Unable to complete deletion of project '{project_uuid}': {reason}",
92+
_version=1,
93+
),
8794
),
8895
ProjectGroupNotFoundError: HttpErrorInfo(
8996
status.HTTP_404_NOT_FOUND,
90-
"Project group not found: {reason}",
97+
user_message(
98+
"The requested project group could not be found: {reason}", _version=1
99+
),
91100
),
92101
ProjectInvalidRightsError: HttpErrorInfo(
93102
status.HTTP_403_FORBIDDEN,
94-
"Do not have sufficient access rights on project {project_uuid} for this action",
103+
user_message(
104+
"You do not have sufficient access rights to perform this action on project {project_uuid}.",
105+
_version=1,
106+
),
95107
),
96108
InsufficientRoleForProjectTemplateTypeUpdateError: HttpErrorInfo(
97109
status.HTTP_403_FORBIDDEN,
98-
"Do not have sufficient access rights on updating project template type",
110+
user_message(
111+
"You do not have sufficient permissions to update the project template type.",
112+
_version=1,
113+
),
99114
),
100115
ProjectInvalidUsageError: HttpErrorInfo(
101116
status.HTTP_422_UNPROCESSABLE_ENTITY,
102-
"Invalid usage for project",
117+
user_message("The project cannot be used in this way.", _version=1),
103118
),
104119
ProjectNotFoundError: HttpErrorInfo(
105120
status.HTTP_404_NOT_FOUND,
106-
"Project {project_uuid} not found",
121+
user_message("Project {project_uuid} could not be found.", _version=1),
107122
),
108123
ProjectOwnerNotFoundInTheProjectAccessRightsError: HttpErrorInfo(
109124
status.HTTP_400_BAD_REQUEST,
110-
"Project owner identifier was not found in the project's access-rights field",
125+
user_message(
126+
"The project owner could not be found in the project's access rights.",
127+
_version=1,
128+
),
111129
),
112130
ProjectTooManyProjectOpenedError: HttpErrorInfo(
113131
status.HTTP_409_CONFLICT,
114-
"You cannot open more than {max_num_projects} study/ies at once. Please close another study and retry.",
132+
user_message(
133+
"You cannot open more than {max_num_projects} project/s at once. Please close another study and retry.",
134+
_version=1,
135+
),
115136
),
116137
ProjectStartsTooManyDynamicNodesError: HttpErrorInfo(
117138
status.HTTP_409_CONFLICT,
118-
"The maximal amount of concurrently running dynamic services was reached. Please manually stop a service and retry.",
139+
user_message(
140+
"The maximum number of concurrently running dynamic services has been reached. Please manually stop a service and retry.",
141+
_version=1,
142+
),
119143
),
120144
ProjectWalletPendingTransactionError: HttpErrorInfo(
121145
status.HTTP_409_CONFLICT,
122-
"Project has currently pending transactions. It is forbidden to change wallet.",
146+
user_message(
147+
"This project has pending transactions. Changing the wallet is currently not allowed.",
148+
_version=1,
149+
),
123150
),
124151
ProjectInDebtCanNotChangeWalletError: HttpErrorInfo(
125152
status.HTTP_402_PAYMENT_REQUIRED,
126-
"Unable to change the credit account linked to the project. The project is embargoed because the last transaction of {debt_amount} resulted in the credit account going negative.",
153+
user_message(
154+
"Unable to change the credit account linked to the project. The project is embargoed because the last transaction of {debt_amount} resulted in the credit account going negative.",
155+
_version=1,
156+
),
127157
),
128158
ProjectInDebtCanNotOpenError: HttpErrorInfo(
129159
status.HTTP_402_PAYMENT_REQUIRED,
130-
"Unable to open the project. The project is embargoed because the last transaction of {debt_amount} resulted in the credit account going negative.",
160+
user_message(
161+
"Unable to open the project. The project is embargoed because the last transaction of {debt_amount} resulted in the credit account going negative.",
162+
_version=1,
163+
),
131164
),
132165
WrongTagIdsInQueryError: HttpErrorInfo(
133166
status.HTTP_400_BAD_REQUEST,
134-
"Wrong tag IDs in query",
167+
user_message("Invalid tag IDs were provided in the request.", _version=1),
135168
),
136169
ProjectTypeAndTemplateIncompatibilityError: HttpErrorInfo(
137170
status.HTTP_400_BAD_REQUEST,
138-
"Wrong project type and template type combination: {reason}",
171+
user_message(
172+
"The project type and template type combination is not valid: {reason}",
173+
_version=1,
174+
),
139175
),
140176
}
141177

142178

143179
_WORKSPACE_ERRORS: ExceptionToHttpErrorMap = {
144180
WorkspaceAccessForbiddenError: HttpErrorInfo(
145181
status.HTTP_403_FORBIDDEN,
146-
"Access to workspace forbidden: {reason}",
182+
user_message("Access to this workspace is forbidden: {reason}", _version=1),
147183
),
148184
WorkspaceNotFoundError: HttpErrorInfo(
149185
status.HTTP_404_NOT_FOUND,
150-
"Workspace not found: {reason}",
186+
user_message(
187+
"The requested workspace could not be found: {reason}", _version=1
188+
),
151189
),
152190
}
153191

154192

155193
_WALLET_ERRORS: ExceptionToHttpErrorMap = {
156194
UserDefaultWalletNotFoundError: HttpErrorInfo(
157195
status.HTTP_404_NOT_FOUND,
158-
"Wallet not found: {reason}",
196+
user_message("The requested wallet could not be found: {reason}", _version=1),
159197
),
160198
WalletAccessForbiddenError: HttpErrorInfo(
161199
status.HTTP_403_FORBIDDEN,
162-
"Payment required, but the user lacks access to the project's linked wallet: Wallet access forbidden. {reason}",
200+
user_message(
201+
"Payment is required, but you do not have access to the project's linked wallet: {reason}",
202+
_version=1,
203+
),
163204
),
164205
WalletNotEnoughCreditsError: HttpErrorInfo(
165206
status.HTTP_402_PAYMENT_REQUIRED,
166-
"Wallet does not have enough credits. {reason}",
207+
user_message(
208+
"The wallet does not have enough credits to complete this operation: {reason}",
209+
_version=1,
210+
),
167211
),
168212
}
169213

170214

171215
_PRICING_ERRORS: ExceptionToHttpErrorMap = {
172216
DefaultPricingPlanNotFoundError: HttpErrorInfo(
173217
status.HTTP_404_NOT_FOUND,
174-
"Default pricing plan not found",
218+
user_message("The default pricing plan could not be found.", _version=1),
175219
),
176220
DefaultPricingUnitNotFoundError: HttpErrorInfo(
177221
status.HTTP_404_NOT_FOUND,
178-
"Default pricing unit not found",
222+
user_message("The default pricing unit could not be found.", _version=1),
179223
),
180224
}
181225

182226

183227
_CONVERSATION_ERRORS: ExceptionToHttpErrorMap = {
184228
ConversationErrorNotFoundError: HttpErrorInfo(
185229
status.HTTP_404_NOT_FOUND,
186-
"Conversation not found",
230+
user_message("The requested conversation could not be found.", _version=1),
187231
),
188232
ConversationMessageErrorNotFoundError: HttpErrorInfo(
189233
status.HTTP_404_NOT_FOUND,
190-
"Conversation message not found",
234+
user_message(
235+
"The requested conversation message could not be found.", _version=1
236+
),
191237
),
192238
}
193239

194240

195241
_OTHER_ERRORS: ExceptionToHttpErrorMap = {
196242
CatalogNotAvailableError: HttpErrorInfo(
197243
status.HTTP_503_SERVICE_UNAVAILABLE,
198-
"This service is currently not available",
244+
user_message("The catalog service is currently unavailable.", _version=1),
199245
),
200246
ClustersKeeperNotAvailableError: HttpErrorInfo(
201247
status.HTTP_503_SERVICE_UNAVAILABLE,
202-
"Clusters-keeper service is not available",
248+
user_message(
249+
"The clusters-keeper service is currently unavailable.", _version=1
250+
),
203251
),
204252
CatalogForbiddenError: HttpErrorInfo(
205253
status.HTTP_403_FORBIDDEN,
206-
"Catalog forbidden: Insufficient access rights for {name}",
254+
user_message(
255+
"Access denied: You do not have sufficient permissions for {name}.",
256+
_version=1,
257+
),
207258
),
208259
CatalogItemNotFoundError: HttpErrorInfo(
209-
status.HTTP_404_NOT_FOUND, "{name} was not found"
260+
status.HTTP_404_NOT_FOUND,
261+
user_message("The requested item '{name}' was not found.", _version=1),
210262
),
211263
}
212264

0 commit comments

Comments
 (0)