Skip to main content

WebSocketException

A WebSocket exception you can raise in your own code to show errors to the client.

Attributes

AttributeTypeDescription
codeintA closing code from the valid codes defined in the specification.
reason`strNone` = None

Constructor

Signature

def WebSocketException(
code: int,
reason: str | None = None
) - > None

Parameters

NameTypeDescription
codeintA closing code from the valid codes defined in the WebSocket specification (RFC 6455).
reason`strNone` = None

Signature

def WebSocketException(
code: int,
reason: str | None = None
) - > null

Parameters

NameTypeDescription
codeintA closing code from the valid codes defined in the RFC 6455 specification section 7.4.1.
reason`strNone` = None