Send an error response on a stream.
(self, stream_id, status_code, message=None)
| 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.""" |