Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/cupertino_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.2.1-wip

* Make `ConnectionException.toString` more helpful.

## 2.2.0

* Cancel requests when the response stream is cancelled.
Expand Down
23 changes: 23 additions & 0 deletions pkgs/cupertino_http/example/integration_test/web_socket_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:cupertino_http/cupertino_http.dart';
import 'package:objective_c/objective_c.dart';
import 'package:test/test.dart';

void main() {
group('ConnectionException', () {
test('toString', () {
expect(
ConnectionException(
'failed to connect',
NSError.errorWithDomain_code_userInfo_(
'NSURLErrorDomain'.toNSString(), -999, null))
.toString(),
'CupertinoErrorWebSocketException: failed to connect '
'[The operation couldn’t be completed. '
'(NSURLErrorDomain error -999.)]');
});
});
}
3 changes: 2 additions & 1 deletion pkgs/cupertino_http/lib/src/cupertino_web_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class ConnectionException extends WebSocketException {
ConnectionException(super.message, this.error);

@override
String toString() => 'CupertinoErrorWebSocketException: $message $error';
String toString() => 'CupertinoErrorWebSocketException: $message '
'[${error.localizedDescription.toDartString()}]';
}

/// A [WebSocket] implemented using the
Expand Down
2 changes: 1 addition & 1 deletion pkgs/cupertino_http/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cupertino_http
version: 2.2.0
version: 2.2.1-wip
description: >-
A macOS/iOS Flutter plugin that provides access to the Foundation URL
Loading System.
Expand Down
Loading