Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,34 @@
from common_library.errors_classes import OsparcErrorMixin


class TaskValueError(OsparcErrorMixin, ValueError): ...


class TaskCancelledError(OsparcErrorMixin, RuntimeError):
msg_template = "The task was cancelled"
class ContainerTaskError(OsparcErrorMixin, RuntimeError):
msg_template = (
"The service {service_key}:{service_version}"
" running in container {container_id} encountered an unexpected error: {error_message}."
)


class ServiceRuntimeError(OsparcErrorMixin, RuntimeError):
class ServiceRuntimeError(ContainerTaskError):
msg_template = (
"The service {service_key}:{service_version}"
" running in container {container_id} failed with code"
" {exit_code}. Last logs:\n{service_logs}"
)


class ServiceInputsUseFileToKeyMapButReceivesZipDataError(
OsparcErrorMixin, RuntimeError
):
class ServiceTimeoutLoggingError(ContainerTaskError):
msg_template = (
"The service {service_key}:{service_version}"
" running in container {container_id} was detected as hanging and forcefully terminated by the platform. "
"This happened because it exceeded the maximum allowed time of {timeout_timedelta} without producing any logs."
)


class TaskCancelledError(ContainerTaskError):
msg_template = "The task was cancelled"


class ServiceInputsUseFileToKeyMapButReceivesZipDataError(ContainerTaskError):
msg_template = (
"The service {service_key}:{service_version} {input} uses a file-to-key {file_to_key_map} map but receives zip data instead. "
"TIP: either pass a single file or zip file and remove the file-to-key map parameter."
Expand Down
Loading
Loading