You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: split ProtocolError into specific subclasses
ProtocolError was raised at six qualitatively different sites —
server-returned FAILURE, stream-desync, handshake-not-done, bad
protocol version, ROWS continuation state-machine misuse, and buffer
poisoning — forcing callers to string-match exception messages to
recover. Add specific subclasses under ProtocolError so callers can
discriminate via the exception class:
- ServerFailure (with structured code/message attributes): peer sent
a FAILURE response; connection is still usable.
- StreamError: stream is at unknown offset; reconnect required.
- PoisonedError (StreamError): buffer was poisoned by a prior
failure; __cause__ carries the original exception.
- HandshakeError: handshake not done, already done, or bad version.
- ContinuationError: ROWS continuation state-machine misuse.
Every new subclass inherits from ProtocolError, so existing
`except ProtocolError` catches continue to work unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments