isNetworkRelated property

bool get isNetworkRelated

Indicates whether this Object is a network related Exception.

Implementation

bool get isNetworkRelated {
  if (this is DioException) {
    final int? code = (this as DioException).response?.statusCode;
    if (code != null) {
      return code < 400 || code >= 500;
    }
  }

  return this is ConnectionException ||
      this is SocketException ||
      this is WebSocketException ||
      this is WebSocketChannelException ||
      this is HttpException ||
      this is ClientException ||
      this is TimeoutException ||
      this is ResubscriptionRequiredException ||
      this is ConnectionException;
}