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

Unified Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 94843002: Unify dart:async and pub/io.dart TimeoutException classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « sdk/lib/_internal/pub/lib/src/http.dart ('k') | sdk/lib/_internal/pub/lib/src/log.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/io.dart
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
index 90b06f9aebf8670929df79aca3925ea430bf927e..f28b852cc37bd3c994420ae2952bd8aa5022242b 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -5,7 +5,8 @@
/// Helper functionality to make working with IO easier.
library pub.io;
-import 'dart:async' hide TimeoutException;
+import 'dart:async';
+export 'dart:async' show TimeoutException;
Bob Nystrom 2013/12/02 22:40:42 Let's remove this and just change any other files
Lasse Reichstein Nielsen 2013/12/03 08:38:29 Removed. I don't think it's needed anywhere, but I
import 'dart:collection';
import 'dart:convert';
import 'dart:io';
@@ -631,9 +632,10 @@ Future _doProcess(Function fn, String executable, List<String> args,
/// [input].
Future timeout(Future input, int milliseconds, String description) {
nweiz 2013/12/02 23:54:22 Add a TODO assigned to me to replace this with [Fu
Lasse Reichstein Nielsen 2013/12/03 08:38:29 Done.
var completer = new Completer();
- var timer = new Timer(new Duration(milliseconds: milliseconds), () {
+ var duration = new Duration(milliseconds: milliseconds);
+ var timer = new Timer(duration, () {
completer.completeError(new TimeoutException(
- 'Timed out while $description.'),
+ 'Timed out while $description.', duration),
new Trace.current());
});
input.then((value) {
@@ -816,15 +818,6 @@ ByteStream createTarGz(List contents, {baseDir}) {
return new ByteStream(controller.stream);
}
-/// Exception thrown when an operation times out.
-class TimeoutException implements Exception {
- final String message;
-
- const TimeoutException(this.message);
-
- String toString() => message;
-}
-
/// Contains the results of invoking a [Process] and waiting for it to complete.
class PubProcessResult {
final List<String> stdout;
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/http.dart ('k') | sdk/lib/_internal/pub/lib/src/log.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698