Skip to content

Commit 37ee729

Browse files
fix errors
1 parent 93161aa commit 37ee729

File tree

1 file changed

+18
-18
lines changed
  • services/director-v2/src/simcore_service_director_v2/core

1 file changed

+18
-18
lines changed

services/director-v2/src/simcore_service_director_v2/core/errors.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
}
2020
"""
2121

22+
from common_library.errors_classes import OsparcErrorMixin
2223
from models_library.errors import ErrorDict
2324
from models_library.projects import ProjectID
2425
from models_library.projects_nodes_io import NodeID
25-
from pydantic.errors import PydanticErrorMixin
2626

2727

2828
class DirectorError(Exception):
@@ -114,15 +114,15 @@ def __init__(self, pipeline_id: str):
114114
super().__init__(f"pipeline {pipeline_id} not found")
115115

116116

117-
class ComputationalRunNotFoundError(PydanticErrorMixin, DirectorError):
117+
class ComputationalRunNotFoundError(OsparcErrorMixin, DirectorError):
118118
msg_template = "Computational run not found"
119119

120120

121-
class ComputationalTaskNotFoundError(PydanticErrorMixin, DirectorError):
121+
class ComputationalTaskNotFoundError(OsparcErrorMixin, DirectorError):
122122
msg_template = "Computational task {node_id} not found"
123123

124124

125-
class WalletNotEnoughCreditsError(PydanticErrorMixin, DirectorError):
125+
class WalletNotEnoughCreditsError(OsparcErrorMixin, DirectorError):
126126
msg_template = "Wallet '{wallet_name}' has {wallet_credit_amount} credits."
127127

128128

@@ -227,38 +227,38 @@ def get_errors(self) -> list[ErrorDict]:
227227
return value_errors
228228

229229

230-
class ComputationalSchedulerChangedError(PydanticErrorMixin, SchedulerError):
230+
class ComputationalSchedulerChangedError(OsparcErrorMixin, SchedulerError):
231231
code = "computational_backend.scheduler_changed"
232232
msg_template = "The dask scheduler ID changed from '{original_scheduler_id}' to '{current_scheduler_id}'"
233233

234234

235-
class ComputationalBackendNotConnectedError(PydanticErrorMixin, SchedulerError):
235+
class ComputationalBackendNotConnectedError(OsparcErrorMixin, SchedulerError):
236236
code = "computational_backend.not_connected"
237237
msg_template = "The dask computational backend is not connected"
238238

239239

240-
class ComputationalBackendNoS3AccessError(PydanticErrorMixin, SchedulerError):
240+
class ComputationalBackendNoS3AccessError(OsparcErrorMixin, SchedulerError):
241241
msg_template = "The S3 backend is not ready, please try again later"
242242

243243

244-
class ComputationalBackendTaskNotFoundError(PydanticErrorMixin, SchedulerError):
244+
class ComputationalBackendTaskNotFoundError(OsparcErrorMixin, SchedulerError):
245245
code = "computational_backend.task_not_found"
246246
msg_template = (
247247
"The dask computational backend does not know about the task '{job_id}'"
248248
)
249249

250250

251-
class ComputationalBackendTaskResultsNotReadyError(PydanticErrorMixin, SchedulerError):
251+
class ComputationalBackendTaskResultsNotReadyError(OsparcErrorMixin, SchedulerError):
252252
code = "computational_backend.task_result_not_ready"
253253
msg_template = "The task result is not ready yet for job '{job_id}'"
254254

255255

256-
class ClustersKeeperNotAvailableError(PydanticErrorMixin, SchedulerError):
256+
class ClustersKeeperNotAvailableError(OsparcErrorMixin, SchedulerError):
257257
code = "computational_backend.clusters_keeper_not_available"
258258
msg_template = "clusters-keeper service is not available!"
259259

260260

261-
class ComputationalBackendOnDemandNotReadyError(PydanticErrorMixin, SchedulerError):
261+
class ComputationalBackendOnDemandNotReadyError(OsparcErrorMixin, SchedulerError):
262262
code = "computational_backend.on_demand_cluster.not_ready"
263263
msg_template = (
264264
"The on demand computational cluster is not ready 'est. remaining time: {eta}'"
@@ -268,16 +268,16 @@ class ComputationalBackendOnDemandNotReadyError(PydanticErrorMixin, SchedulerErr
268268
#
269269
# SCHEDULER/CLUSTER ERRORS
270270
#
271-
class ClusterNotFoundError(PydanticErrorMixin, SchedulerError):
271+
class ClusterNotFoundError(OsparcErrorMixin, SchedulerError):
272272
code = "cluster.not_found"
273273
msg_template = "The cluster '{cluster_id}' not found"
274274

275275

276-
class ClusterAccessForbiddenError(PydanticErrorMixin, SchedulerError):
276+
class ClusterAccessForbiddenError(OsparcErrorMixin, SchedulerError):
277277
msg_template = "Insufficient rights to access cluster '{cluster_id}'"
278278

279279

280-
class ClusterInvalidOperationError(PydanticErrorMixin, SchedulerError):
280+
class ClusterInvalidOperationError(OsparcErrorMixin, SchedulerError):
281281
msg_template = "Invalid operation on cluster '{cluster_id}'"
282282

283283

@@ -286,24 +286,24 @@ class ClusterInvalidOperationError(PydanticErrorMixin, SchedulerError):
286286
#
287287

288288

289-
class DaskClientRequestError(PydanticErrorMixin, SchedulerError):
289+
class DaskClientRequestError(OsparcErrorMixin, SchedulerError):
290290
code = "dask_client.request.error"
291291
msg_template = (
292292
"The dask client to cluster on '{endpoint}' did an invalid request '{error}'"
293293
)
294294

295295

296-
class DaskClusterError(PydanticErrorMixin, SchedulerError):
296+
class DaskClusterError(OsparcErrorMixin, SchedulerError):
297297
code = "cluster.error"
298298
msg_template = "The dask cluster on '{endpoint}' encountered an error: '{error}'"
299299

300300

301-
class DaskGatewayServerError(PydanticErrorMixin, SchedulerError):
301+
class DaskGatewayServerError(OsparcErrorMixin, SchedulerError):
302302
code = "gateway.error"
303303
msg_template = "The dask gateway on '{endpoint}' encountered an error: '{error}'"
304304

305305

306-
class DaskClientAcquisisitonError(PydanticErrorMixin, SchedulerError):
306+
class DaskClientAcquisisitonError(OsparcErrorMixin, SchedulerError):
307307
code = "dask_client.acquisition.error"
308308
msg_template = (
309309
"The dask client to cluster '{cluster}' encountered an error '{error}'"

0 commit comments

Comments
 (0)