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

Unified Diff: utils/pub/http.dart

Issue 11785028: Commit Martin's patch for pub + lib_v2. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. 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 | « utils/pub/hosted_source.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/http.dart
diff --git a/utils/pub/http.dart b/utils/pub/http.dart
index 0665c355cd26d6bfd203a163c379c10109d3b72e..7218562f0868ecb1831884f513b09313fd4b2f7d 100644
--- a/utils/pub/http.dart
+++ b/utils/pub/http.dart
@@ -5,6 +5,7 @@
/// Helpers for dealing with HTTP.
library pub.http;
+import 'dart:async';
import 'dart:io';
import 'dart:json';
@@ -41,7 +42,7 @@ class PubHttpClient extends http.BaseClient {
// TODO(nweiz): Ideally the timeout would extend to reading from the
// response input stream, but until issue 3657 is fixed that's not feasible.
- return timeout(inner.send(request).chain((streamedResponse) {
+ return timeout(inner.send(request).then((streamedResponse) {
log.fine("Got response ${streamedResponse.statusCode} "
"${streamedResponse.reasonPhrase}.");
@@ -52,10 +53,10 @@ class PubHttpClient extends http.BaseClient {
return new Future.immediate(streamedResponse);
}
- return http.Response.fromStream(streamedResponse).transform((response) {
+ return http.Response.fromStream(streamedResponse).then((response) {
throw new PubHttpException(response);
});
- }).transformException((e) {
+ }).catchError((e) {
if (e is SocketIOException &&
e.osError != null &&
(e.osError.errorCode == 8 ||
« no previous file with comments | « utils/pub/hosted_source.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698