MCPcopy
hub / github.com/benoitc/gunicorn / send_error

Method send_error

gunicorn/http2/async_connection.py:527–534  ·  view source on GitHub ↗

Send an error response on a stream.

(self, stream_id, status_code, message=None)

Source from the content-addressed store, hash-verified

525 return False
526
527 async def send_error(self, stream_id, status_code, message=None):
528 """Send an error response on a stream."""
529 body = message.encode() if message else b''
530 headers = [('content-length', str(len(body)))]
531 if body:
532 headers.append(('content-type', 'text/plain; charset=utf-8'))
533
534 await self.send_response(stream_id, status_code, headers, body)
535
536 async def reset_stream(self, stream_id, error_code=0x8):
537 """Reset a stream with RST_STREAM."""

Callers 2

test_send_errorMethod · 0.95

Calls 2

send_responseMethod · 0.95
encodeMethod · 0.80

Tested by 1

test_send_errorMethod · 0.76