Skip to content

Commit 30ea3fe

Browse files
committed
fixe mypy
1 parent 66b47b8 commit 30ea3fe

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ async def _middleware_handler(request: web.Request, handler: Handler):
213213
return result
214214

215215
# adds identifier (mostly for debugging)
216-
_middleware_handler.__middleware_name__ = f"{__name__}.error_{api_version}"
216+
setattr( # noqa: B010
217+
_middleware_handler, "__middleware_name__", f"{__name__}.error_{api_version}"
218+
)
217219

218220
return _middleware_handler
219221

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def safe_status_message(
7575
def create_http_error(
7676
errors: list[Exception] | Exception,
7777
error_message: str | None = None,
78-
http_error_cls: type[T_HTTPError] = web.HTTPInternalServerError,
78+
http_error_cls: type[
79+
T_HTTPError
80+
] = web.HTTPInternalServerError, # type: ignore[assignment]
7981
*,
8082
status_reason: str | None = None,
8183
skip_internal_error_details: bool = False,
@@ -86,6 +88,7 @@ def create_http_error(
8688
- Can skip internal details when 500 status e.g. to avoid transmitting server
8789
exceptions to the client in production
8890
"""
91+
8992
status_reason = status_reason or get_code_display_name(http_error_cls.status_code)
9093
error_message = error_message or get_code_description(http_error_cls.status_code)
9194

0 commit comments

Comments
 (0)