SocketError class

SocketError

Represents a WebSocket error with categorization and metadata.

Key Features:

  • Error type categorization for granular handling
  • Original error preservation for debugging
  • Timestamp for error tracking

Usage Example:

socketService.errorStream.listen((error) {
  if (error.type == SocketErrorType.authentication) {
    // Token expired, refresh and reconnect
    refreshToken().then((_) => socketService.connect());
  }
});

Constructors

SocketError({required SocketErrorType type, required String message, dynamic originalError, DateTime? timestamp})

Properties

hashCode int
The hash code for this object.
no setterinherited
message String
final
originalError → dynamic
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
final
type SocketErrorType
final

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