Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release History
===============

1.4.0 (unreleased)
------------------

- Require ``event_hint`` when constructing ``RemoteProtocolError``.
This is an API-breaking change.

1.3.2 (2025-11-20)
------------------

Expand Down
7 changes: 4 additions & 3 deletions src/wsproto/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ class RemoteProtocolError(ProtocolError):

.. attribute:: event_hint

This is a suggested wsproto Event to send to the client based
on the error. It could be None if no hint is available.
This is the suggested wsproto Event to send to the client based
on the error.

"""

def __init__(self, message: str, event_hint: Event | None = None) -> None:
# API-breaking change for the next minor release: event_hint is required.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-versionchanged

example:

    .. versionchanged:: 2.3.0
       Changed the type of ``headers`` to :class:`HeaderTuple
       <hpack:hpack.HeaderTuple>`. This has no effect on current users.

def __init__(self, message: str, event_hint: Event) -> None:
self.event_hint = event_hint
super().__init__(message)

Expand Down