FastAPI · Error
WebSocketException
WebSocketException lets a FastAPI WebSocket endpoint reject a client with a closing code and optional reason. Raise it for client errors such as invalid authentication or invalid data.
Last updated
Syntax
WebSocketException(code, reason=None)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
WebSocketstatusDependsCookieQueryFastAPI