Skip to content

Commit 1fe64fa

Browse files
committed
fix
1 parent 6496ae2 commit 1fe64fa

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,10 @@ def error_middleware_factory(
5050
def _process_and_raise_unexpected_error(request: web.BaseRequest, err: Exception):
5151

5252
error_code = create_error_code(err)
53-
error_context = {
54-
"request.remote",
55-
request.remote,
56-
"request.method",
57-
request.method,
58-
"request.path",
59-
request.path,
53+
error_context: dict[str, Any] = {
54+
"request.remote": f"{request.remote}",
55+
"request.method": f"{request.method}",
56+
"request.path": f"{request.path}",
6057
}
6158
if isinstance(err, OsparcErrorMixin):
6259
error_context.update(err.error_context())
@@ -79,7 +76,7 @@ def _process_and_raise_unexpected_error(request: web.BaseRequest, err: Exception
7976
log_msg,
8077
extra=get_log_record_extra(
8178
error_code=error_code,
82-
user_id=error_context.get("user_id", None),
79+
user_id=error_context.get("user_id"),
8380
),
8481
)
8582
raise http_error

0 commit comments

Comments
 (0)