Exceptions¶
MicroPie defines a small number of exceptions. The most commonly
encountered is ConnectionClosed, used for WebSocket
disconnections.
ConnectionClosed¶
- class ConnectionClosed¶
Raised by
receive_text()andreceive_bytes()when the client closes the WebSocket connection. Catch this exception to detect disconnection and exit your handler gracefully. The exception does not carry any attributes; the WebSocket connection has already been closed when it is raised.