Skip to content

Commit 5e0685d

Browse files
MirochillKriechi
andauthored
Require event hints for remote protocol errors (#202)
Co-authored-by: Miro <200482516+Mirochill@users.noreply.github.com> Co-authored-by: Thomas Kriechbaumer <thomas@kriechbaumer.name>
1 parent b2239f4 commit 5e0685d

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Release History
22
===============
33

4+
1.4.0 (unreleased)
5+
------------------
6+
7+
- Require ``event_hint`` when constructing ``RemoteProtocolError``.
8+
This is an API-breaking change.
9+
410
1.3.2 (2025-11-20)
511
------------------
612

src/wsproto/utilities.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ class RemoteProtocolError(ProtocolError):
4747
4848
.. attribute:: event_hint
4949
50-
This is a suggested wsproto Event to send to the client based
51-
on the error. It could be None if no hint is available.
50+
This is the suggested wsproto Event to send to the client based
51+
on the error.
52+
53+
.. versionchanged:: 1.4.0
54+
Made ``event_hint`` a required argument.
5255
5356
"""
5457

55-
def __init__(self, message: str, event_hint: Event | None = None) -> None:
58+
def __init__(self, message: str, event_hint: Event) -> None:
5659
self.event_hint = event_hint
5760
super().__init__(message)
5861

0 commit comments

Comments
 (0)