Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit af7fda0

Browse files
author
Sean Quah
committed
Assert instead of logging an error
1 parent bc60c6d commit af7fda0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

synapse/logging/opentracing.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,12 +807,10 @@ def err_back(result):
807807
result.addCallbacks(call_back, err_back)
808808

809809
else:
810-
if inspect.iscoroutine(result):
811-
logger.error(
812-
"@trace did not wrap %s correctly! "
813-
"The function is not async but returns a coroutine.",
814-
func.__qualname__,
815-
)
810+
assert not inspect.iscoroutine(result), (
811+
f"@trace did not wrap {func.__qualname__} correctly! "
812+
"The function is not async but returns a coroutine."
813+
)
816814

817815
scope.__exit__(None, None, None)
818816

0 commit comments

Comments
 (0)