Skip to content

Commit 53dba5e

Browse files
author
Andrei Neagu
committed
new modern error types
1 parent 1cff9e8 commit 53dba5e

File tree

1 file changed

+0
-9
lines changed
  • packages/service-library/src/servicelib/long_running_tasks

1 file changed

+0
-9
lines changed

packages/service-library/src/servicelib/long_running_tasks/_errors.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,36 @@
44
class BaseLongRunningError(OsparcErrorMixin, Exception):
55
"""base exception for this module"""
66

7-
code: str = "long_running_task.base_long_running_error" # type: ignore[assignment]
8-
97

108
class TaskAlreadyRunningError(BaseLongRunningError):
11-
code: str = "long_running_task.task_already_running"
129
msg_template: str = "{task_name} must be unique, found: '{managed_task}'"
1310

1411

1512
class TaskNotFoundError(BaseLongRunningError):
16-
code: str = "long_running_task.task_not_found"
1713
msg_template: str = "No task with {task_id} found"
1814

1915

2016
class TaskNotCompletedError(BaseLongRunningError):
21-
code: str = "long_running_task.task_not_completed"
2217
msg_template: str = "Task {task_id} has not finished yet"
2318

2419

2520
class TaskCancelledError(BaseLongRunningError):
26-
code: str = "long_running_task.task_cancelled_error"
2721
msg_template: str = "Task {task_id} was cancelled before completing"
2822

2923

3024
class TaskExceptionError(BaseLongRunningError):
31-
code: str = "long_running_task.task_exception_error"
3225
msg_template: str = (
3326
"Task {task_id} finished with exception: '{exception}'\n{traceback}"
3427
)
3528

3629

3730
class TaskClientTimeoutError(BaseLongRunningError):
38-
code: str = "long_running_task.client.timed_out_waiting_for_response"
3931
msg_template: str = (
4032
"Timed out after {timeout} seconds while awaiting '{task_id}' to complete"
4133
)
4234

4335

4436
class GenericClientError(BaseLongRunningError):
45-
code: str = "long_running_task.client.generic_error"
4637
msg_template: str = (
4738
"Unexpected error while '{action}' for '{task_id}': status={status} body={body}"
4839
)

0 commit comments

Comments
 (0)