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

Unified Diff: utils/pub/io.dart

Issue 11468039: Make pipeInputToInput yet more resilient to stream closure. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Previous fix didn't work Created 8 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index ce29231f22297a6973ae92e44828609681030a11..859edb30683ee97da62e32911e9164f346c5fb86 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -582,7 +582,13 @@ Future pipeInputToInput(InputStream source, ListInputStream sink) {
// Even if the sink is closed and we aren't going to do anything with more
// data, we still need to drain it from source to work around issue 7218.
var data = source.read();
- if (!sink.closed) sink.write(data);
+ try {
+ if (!sink.closed) sink.write(data);
+ } on StreamException catch (e, stackTrace) {
+ // Ignore an exception to work around issue 4222.
+ log.io("Writing to an unclosed ListInputStream caused exception $e\n"
+ "$stackTrace");
+ }
};
// TODO(nweiz): propagate this error to the sink. See issue 3657.
source.onError = (e) { throw e; };
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698