Skip to content
Snippets Groups Projects
  • David Robertson's avatar
    1bfd1412
    Type hints for the remaining two files in `synapse.http`. (#11164) · 1bfd1412
    David Robertson authored
    
    * 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: default avatarreivilibre <oliverw@matrix.org>
    Type hints for the remaining two files in `synapse.http`. (#11164)
    David Robertson authored
    
    * 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: default avatarreivilibre <oliverw@matrix.org>