-
- Downloads
Type hints for the remaining two files in `synapse.http`. (#11164)
* Teach MyPy that the sentinel context is False
This means that if `ctx: LoggingContextOrSentinel`
then `bool(ctx)` narrows us to `ctx:LoggingContext`, which is a really
neat find!
* Annotate RequestMetrics
- Raise errors for sentry if we use the sentinel context
- Ensure we don't raise an error and carry on, but not recording stats
- Include stack trace in the error case to lower Sean's blood pressure
* Make mypy pass for synapse.http.request_metrics
* Make synapse.http.connectproxyclient pass mypy
Co-authored-by:
reivilibre <oliverw@matrix.org>
Showing
- changelog.d/11164.misc 1 addition, 0 deletionschangelog.d/11164.misc
- mypy.ini 2 additions, 10 deletionsmypy.ini
- synapse/http/connectproxyclient.py 9 additions, 3 deletionssynapse/http/connectproxyclient.py
- synapse/http/request_metrics.py 33 additions, 17 deletionssynapse/http/request_metrics.py
- synapse/logging/context.py 2 additions, 2 deletionssynapse/logging/context.py
- synapse/metrics/__init__.py 9 additions, 5 deletionssynapse/metrics/__init__.py
Loading
Please register or sign in to comment