Skip to content

Commit 8df445f

Browse files
committed
Merge branch 'master' into handle_function_errors_api
2 parents 27494dd + 6748f5e commit 8df445f

File tree

97 files changed

+1226
-605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1226
-605
lines changed

api/tests/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
aiohappyeyeballs==2.4.6
1+
aiohappyeyeballs==2.6.1
22
# via aiohttp
3-
aiohttp==3.11.18
3+
aiohttp==3.12.7
44
# via
55
# -c ../../requirements/constraints.txt
66
# -r requirements.in

ci/helpers/requirements/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
aiohappyeyeballs==2.6.1
22
# via aiohttp
3-
aiohttp==3.11.18
3+
aiohttp==3.12.7
44
# via
55
# -c requirements/../../../requirements/constraints.txt
66
# -r requirements/requirements.in

packages/aws-library/requirements/_base.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ aiofiles==24.1.0
1616
# via
1717
# -r requirements/../../../packages/service-library/requirements/_base.in
1818
# aioboto3
19-
aiohappyeyeballs==2.4.6
19+
aiohappyeyeballs==2.6.1
2020
# via aiohttp
21-
aiohttp==3.11.18
21+
aiohttp==3.12.7
2222
# via
2323
# -c requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt
2424
# -c requirements/../../../packages/models-library/requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
""" Dask task exceptions
1+
"""Dask task exceptions"""
22

3-
"""
43
from common_library.errors_classes import OsparcErrorMixin
54

65

7-
class TaskValueError(OsparcErrorMixin, ValueError):
8-
...
6+
class TaskValueError(OsparcErrorMixin, ValueError): ...
97

108

119
class TaskCancelledError(OsparcErrorMixin, RuntimeError):
@@ -18,3 +16,12 @@ class ServiceRuntimeError(OsparcErrorMixin, RuntimeError):
1816
" running in container {container_id} failed with code"
1917
" {exit_code}. Last logs:\n{service_logs}"
2018
)
19+
20+
21+
class ServiceInputsUseFileToKeyMapButReceivesZipDataError(
22+
OsparcErrorMixin, RuntimeError
23+
):
24+
msg_template = (
25+
"The service {service_key}:{service_version} {input} uses a file-to-key {file_to_key_map} map but receives zip data instead. "
26+
"TIP: either pass a single file or zip file and remove the file-to-key map parameter."
27+
)

packages/models-library/src/models_library/functions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ class FunctionClass(str, Enum):
7676
# see here https://github.com/ITISFoundation/osparc-simcore/issues/7659
7777
FunctionInputs: TypeAlias = dict[str, Any] | None
7878

79-
FunctionInputsList: TypeAlias = list[FunctionInputs]
79+
FunctionInputsList: TypeAlias = Annotated[
80+
list[FunctionInputs],
81+
Field(max_length=50),
82+
]
8083

8184
FunctionOutputs: TypeAlias = dict[str, Any] | None
8285

packages/notifications-library/requirements/_test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
aiodocker==0.24.0
22
# via -r requirements/_test.in
3-
aiohappyeyeballs==2.4.6
3+
aiohappyeyeballs==2.6.1
44
# via aiohttp
5-
aiohttp==3.11.18
5+
aiohttp==3.12.7
66
# via
77
# -c requirements/../../../requirements/constraints.txt
88
# aiodocker

packages/service-library/requirements/_aiohttp.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
aiohappyeyeballs==2.4.6
1+
aiohappyeyeballs==2.6.1
22
# via aiohttp
3-
aiohttp==3.11.18
3+
aiohttp==3.12.7
44
# via -r requirements/_aiohttp.in
55
aiopg==1.4.0
66
# via -r requirements/_aiohttp.in

packages/service-library/requirements/_base.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ aiodocker==0.24.0
88
# via -r requirements/_base.in
99
aiofiles==24.1.0
1010
# via -r requirements/_base.in
11-
aiohappyeyeballs==2.4.6
11+
aiohappyeyeballs==2.6.1
1212
# via aiohttp
13-
aiohttp==3.11.18
13+
aiohttp==3.12.7
1414
# via
1515
# -c requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt
1616
# -c requirements/../../../packages/models-library/requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt

packages/service-library/requirements/_test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
aiohappyeyeballs==2.4.6
1+
aiohappyeyeballs==2.6.1
22
# via
33
# -c requirements/_aiohttp.txt
44
# -c requirements/_base.txt
55
# aiohttp
6-
aiohttp==3.11.18
6+
aiohttp==3.12.7
77
# via
88
# -c requirements/../../../requirements/constraints.txt
99
# -c requirements/_aiohttp.txt

packages/service-library/src/servicelib/aiohttp/rest_middlewares.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
from ..mimetype_constants import MIMETYPE_APPLICATION_JSON
1919
from ..rest_responses import is_enveloped_from_map, is_enveloped_from_text
2020
from ..utils import is_production_environ
21-
from .rest_responses import create_data_response, create_http_error, wrap_as_envelope
21+
from .rest_responses import (
22+
create_data_response,
23+
create_http_error,
24+
safe_status_message,
25+
wrap_as_envelope,
26+
)
2227
from .rest_utils import EnvelopeFactory
2328
from .typing_extension import Handler, Middleware
2429

@@ -83,6 +88,8 @@ async def _middleware_handler(request: web.Request, handler: Handler): # noqa:
8388
except web.HTTPError as err:
8489

8590
err.content_type = MIMETYPE_APPLICATION_JSON
91+
if err.reason:
92+
err.set_status(err.status, safe_status_message(message=err.reason))
8693

8794
if not err.text or not is_enveloped_from_text(err.text):
8895
error_message = err.text or err.reason or "Unexpected error"
@@ -102,6 +109,9 @@ async def _middleware_handler(request: web.Request, handler: Handler): # noqa:
102109

103110
except web.HTTPSuccessful as err:
104111
err.content_type = MIMETYPE_APPLICATION_JSON
112+
if err.reason:
113+
err.set_status(err.status, safe_status_message(message=err.reason))
114+
105115
if err.text:
106116
try:
107117
payload = json_loads(err.text)
@@ -176,10 +186,7 @@ async def _middleware_handler(
176186
return resp
177187

178188
if not isinstance(resp, StreamResponse):
179-
resp = create_data_response(
180-
data=resp,
181-
skip_internal_error_details=_is_prod,
182-
)
189+
resp = create_data_response(data=resp)
183190

184191
assert isinstance(resp, web.StreamResponse) # nosec
185192
return resp

0 commit comments

Comments
 (0)