WebSocketException class

Exception thrown when WebSocket operations fail.

Implemented types

Constructors

WebSocketException(String message, {Object? cause, StackTrace? stackTrace})
Creates a new WebSocketException.
const
WebSocketException.connectionFailed(String reason, {Object? cause, StackTrace? stackTrace})
Creates a WebSocketException for connection failures.
const
WebSocketException.messageSendFailed(String reason, {Object? cause, StackTrace? stackTrace})
Creates a WebSocketException for message sending failures.
const
WebSocketException.reconnectionFailed(String reason, {Object? cause, StackTrace? stackTrace})
Creates a WebSocketException for reconnection failures.
const
WebSocketException.timeout(String operation, {Object? cause, StackTrace? stackTrace})
Creates a WebSocketException for timeout errors.
const

Properties

cause → Object?
The underlying error that caused this exception.
final
hashCode → int
The hash code for this object.
no setterinherited
message → String
The error message describing what went wrong.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackTrace → StackTrace?
The stack trace at the time this exception was created.
final

Methods

copyWith({String? message, Object? cause, StackTrace? stackTrace}) → WebSocketException
Returns a copy of this exception with updated fields.
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