Skip to content

Commit

Permalink
Correct the RuntimeError message content in websockets (#2141)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grvzard authored May 3, 2023
1 parent 9ebfafa commit 7c4fd9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions starlette/websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ async def send(self, message: Message) -> None:
message_type = message["type"]
if message_type not in {"websocket.accept", "websocket.close"}:
raise RuntimeError(
'Expected ASGI message "websocket.connect", '
f"but got {message_type!r}"
'Expected ASGI message "websocket.accept" or '
f'"websocket.close", but got {message_type!r}'
)
if message_type == "websocket.close":
self.application_state = WebSocketState.DISCONNECTED
Expand Down

0 comments on commit 7c4fd9c

Please sign in to comment.