Skip to content

Commit 03b5813

Browse files
Cycloctaneprovinzkraut
authored andcommitted
Merge commit from fork
1 parent ad8ad72 commit 03b5813

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

litestar/logging/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _default_exception_logging_handler(logger: Logger, scope: Scope, tb: list[st
144144

145145
def _default_exception_logging_handler(logger: Logger, scope: Scope, tb: list[str]) -> None:
146146
logger.exception(
147-
"Uncaught exception (connection_type=%s, path=%s):",
147+
"Uncaught exception (connection_type=%s, path=%r):",
148148
scope["type"],
149149
scope["path"],
150150
)

tests/unit/test_middleware/test_exception_handler_middleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def handler() -> None:
245245
if should_log:
246246
assert len(caplog.records) == 1
247247
assert caplog.records[0].levelname == "ERROR"
248-
assert caplog.records[0].message.startswith("Uncaught exception (connection_type=http, path=/test):")
248+
assert caplog.records[0].message.startswith("Uncaught exception (connection_type=http, path='/test'):")
249249
else:
250250
assert not caplog.records
251251
assert "Uncaught exception" not in response.text
@@ -357,7 +357,7 @@ def handler() -> None:
357357
assert "Test debug exception" in response.text
358358
assert len(caplog.records) == 1
359359
assert caplog.records[0].levelname == "ERROR"
360-
assert caplog.records[0].message.startswith("Uncaught exception (connection_type=http, path=/test):")
360+
assert caplog.records[0].message.startswith("Uncaught exception (connection_type=http, path='/test'):")
361361

362362

363363
def test_get_symbol_name_where_type_doesnt_support_bool() -> None:

0 commit comments

Comments
 (0)