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

Commit

Permalink
Assert instead of logging an error
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Quah committed Oct 6, 2021
1 parent bc60c6d commit af7fda0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions synapse/logging/opentracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,12 +807,10 @@ def err_back(result):
result.addCallbacks(call_back, err_back)

else:
if inspect.iscoroutine(result):
logger.error(
"@trace did not wrap %s correctly! "
"The function is not async but returns a coroutine.",
func.__qualname__,
)
assert not inspect.iscoroutine(result), (
f"@trace did not wrap {func.__qualname__} correctly! "
"The function is not async but returns a coroutine."
)

scope.__exit__(None, None, None)

Expand Down

0 comments on commit af7fda0

Please sign in to comment.