MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _write_error_response

Method _write_error_response

tests/test_connect.py:2014–2021  ·  view source on GitHub ↗
(self, exc_type)

Source from the content-addressed store, hash-verified

2012 message_type + self.MESSAGE_LENGTH.pack(length) + payload)
2013
2014 def _write_error_response(self, exc_type):
2015 fields = (
2016 (b'S', b'FATAL'), # Severity
2017 (b'C', exc_type.sqlstate.encode('ascii')), # SQLSTATE
2018 (b'M', b'proxy startup error'), # Message
2019 )
2020 payload = b''.join(tag + value + b'\0' for tag, value in fields)
2021 self._write_message(b'E', payload + b'\0')
2022
2023
2024class BaseTestSSLConnection(tb.ConnectedTestCase, tb.ProxiedClusterTestCase):

Callers 1

prepareMethod · 0.95

Calls 1

_write_messageMethod · 0.95

Tested by

no test coverage detected