Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Unified Diff: pkg/http/lib/http.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/fixnum/test/int_64_vm_test.dart ('k') | pkg/http/lib/src/base_client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/http.dart
diff --git a/pkg/http/lib/http.dart b/pkg/http/lib/http.dart
index ee074f77a4287dbceb83dcad61b43352371e8a3e..bb59726cf7380ab04d77b78f0fd7b9f87a874963 100644
--- a/pkg/http/lib/http.dart
+++ b/pkg/http/lib/http.dart
@@ -27,7 +27,7 @@
/// "http://example.com/whatsit/create",
/// fields: {"name": "doodle", "color": "blue"})
/// .chain((response) => client.get(response.bodyFields['uri']))
-/// .transform((response) => print(response.body))
+/// .then((response) => print(response.body))
/// .onComplete((_) => client.close());
///
/// You can also exert more fine-grained control over your requests and
@@ -53,6 +53,7 @@
library http;
+import 'dart:async';
import 'dart:scalarlist';
import 'dart:uri';
@@ -168,6 +169,6 @@ Future<Uint8List> readBytes(url, {Map<String, String> headers}) =>
Future _withClient(Future fn(Client)) {
var client = new Client();
var future = fn(client);
- future.onComplete((_) => client.close());
+ future.catchError((_) {}).then((_) => client.close());
return future;
}
« no previous file with comments | « pkg/fixnum/test/int_64_vm_test.dart ('k') | pkg/http/lib/src/base_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698