WebSocketException class sealed

Every error the client reports is a WebSocketException. Raw SocketExceptions, browser events or native error strings never reach the user; they are kept as WebSocketException.cause.

The set of subclasses is fixed for 2.x, so a switch over them can be exhaustive; finer reasons are enums inside them (WebSocketConnectionFailure, WebSocketTlsFailure, WebSocketRpcFailure).

dart:io also declares a WebSocketException; in a file that imports both, the one from this package wins silently. Import this package with a prefix there (import 'package:ws/ws.dart' as ws;).

Implemented types
Implementers

Properties

cause → Object?
The underlying error, if any (for logs only; its type is not part of the API).
final
hashCode → int
The hash code for this object.
no setterinherited
message → String
Description of the error.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited