Skip to content

Commit 8d87e8c

Browse files
remove unused code field
1 parent 09420c6 commit 8d87e8c

File tree

10 files changed

+4
-24
lines changed

10 files changed

+4
-24
lines changed

packages/aws-library/src/aws_library/s3/_errors.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,20 @@ class S3NotConnectedError(S3RuntimeError):
1010

1111

1212
class S3AccessError(S3RuntimeError):
13-
code = "s3_access.error" # type: ignore[assignment]
1413
msg_template: str = "Unexpected error while accessing S3 backend"
1514

1615

1716
class S3BucketInvalidError(S3AccessError):
18-
code = "s3_bucket.invalid_error" # type: ignore[assignment]
1917
msg_template: str = "The bucket '{bucket}' is invalid"
2018

2119

2220
class S3KeyNotFoundError(S3AccessError):
23-
code = "s3_key.not_found_error" # type: ignore[assignment]
2421
msg_template: str = "The file {key} in {bucket} was not found"
2522

2623

2724
class S3UploadNotFoundError(S3AccessError):
28-
code = "s3_upload.not_found_error" # type: ignore[assignment]
2925
msg_template: str = "The upload for {key} in {bucket} was not found"
3026

3127

3228
class S3DestinationNotEmptyError(S3AccessError):
33-
code = "s3_destination.not_empty_error" # type: ignore[assignment]
3429
msg_template: str = "The destination {dst_prefix} is not empty"

packages/common-library/tests/test_errors_classes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ class MyValueError(MyBaseError, ValueError):
4949
assert f"{error}" == "Wrong value 42"
5050

5151
class MyTypeError(MyBaseError, TypeError):
52-
code = "i_want_this"
5352
msg_template = "Wrong type {type}"
5453

5554
error = MyTypeError(type="int")
5655

57-
assert error.code == "i_want_this"
5856
assert f"{error}" == "Wrong type int"
5957

6058

packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55

66

77
class TaskValueError(OsparcErrorMixin, ValueError):
8-
code = "task.value_error" # type: ignore[assignment]
8+
...
99

1010

1111
class TaskCancelledError(OsparcErrorMixin, RuntimeError):
12-
code = "task.cancelled_error" # type: ignore[assignment]
1312
msg_template = "The task was cancelled"
1413

1514

1615
class ServiceRuntimeError(OsparcErrorMixin, RuntimeError):
17-
code = "service.runtime_error" # type: ignore[assignment]
1816
msg_template = (
1917
"The service {service_key}:{service_version}"
2018
" running in container {container_id} failed with code"

packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424

2525
class PortValueError(OsparcErrorMixin, ValueError):
26-
code = "port_validation.schema_error" # type: ignore
2726
msg_template = "Invalid value in port {port_key!r}: {schema_error_message}"
2827

2928
# pylint: disable=useless-super-delegation
@@ -38,7 +37,6 @@ def __init__(self, *, port_key: str, schema_error: JsonSchemaValidationError):
3837

3938

4039
class PortUnitError(OsparcErrorMixin, ValueError):
41-
code = "port_validation.unit_error" # type: ignore
4240
msg_template = "Invalid unit in port {port_key!r}: {pint_error_msg}"
4341

4442
# pylint: disable=useless-super-delegation

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,13 @@ def get_errors(self) -> list[ErrorDict]:
167167
class MissingComputationalResourcesError(TaskSchedulingError):
168168
"""A task cannot be scheduled because the cluster does not have the required resources"""
169169

170-
code = "scheduler_error.missing_resources"
171-
172170
def __init__(self, project_id: ProjectID, node_id: NodeID, msg: str | None = None):
173171
super().__init__(project_id, node_id, msg=msg)
174172

175173

176174
class InsuficientComputationalResourcesError(TaskSchedulingError):
177175
"""A task cannot be scheduled because the cluster does not have *enough* of the required resources"""
178176

179-
code = "scheduler_error.insuficient_resources"
180-
181177
def __init__(self, project_id: ProjectID, node_id: NodeID, msg: str | None = None):
182178
super().__init__(project_id, node_id, msg=msg)
183179

services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ class LegacyServiceIsNotSupportedError(DirectorError):
4040

4141

4242
class UnexpectedContainerStatusError(OsparcErrorMixin, DynamicSidecarError):
43-
code = "dynamic_sidecar.container_status" # type: ignore
4443
msg_template = "Unexpected status from containers: {containers_with_error}"

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class BaseDynamicSchedulerError(OsparcErrorMixin, ValueError):
5-
code = "simcore.service.dynamic.scheduler" # type:ignore[assignment]
5+
...

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, message: str, status_code: int) -> None:
3636

3737

3838
class BaseError(OsparcErrorMixin, BaseDynamicSidecarError):
39-
code = "dy_sidecar.error" # type: ignore[assignment]
39+
...
4040

4141

4242
class ContainerExecContainerNotFoundError(BaseError):

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class BaseServicesPreferencesError(OsparcErrorMixin, Exception):
5-
code = "dynamic_sidecar.user_service_preferences" # type: ignore[assignment]
5+
...
66

77

88
class DestinationIsNotADirectoryError(BaseServicesPreferencesError):

services/web/server/src/simcore_service_webserver/studies_dispatcher/_errors.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@ class StudyDispatcherError(WebServerBaseError, ValueError):
66

77

88
class IncompatibleService(StudyDispatcherError):
9-
code = "studies_dispatcher.incompatible_service" # type: ignore
109
msg_template = "None of the registered services can handle '{file_type}'"
1110

1211

1312
class FileToLarge(StudyDispatcherError):
14-
code = "studies_dispatcher.file_to_large" # type: ignore
1513
msg_template = "File size {file_size_in_mb} MB is over allowed limit"
1614

1715

1816
class ServiceNotFound(StudyDispatcherError):
19-
code = "studies_dispatcher.service_not_found" # type: ignore
2017
msg_template = "Service {service_key}:{service_version} not found"
2118

2219

2320
class InvalidRedirectionParams(StudyDispatcherError):
24-
code = "studies_dispatcher.invalid_redirection_params" # type: ignore
2521
msg_template = (
2622
"The link you provided is invalid because it doesn't contain any information related to data or a service."
2723
" Please check the link and make sure it is correct."

0 commit comments

Comments
 (0)