| Index: utils/pub/system_cache.dart
|
| diff --git a/utils/pub/system_cache.dart b/utils/pub/system_cache.dart
|
| index 1e26554cd72a177088c1a83779d6940b07e50b1d..e0d13457a399a07b9ff3c827c79571223e837366 100644
|
| --- a/utils/pub/system_cache.dart
|
| +++ b/utils/pub/system_cache.dart
|
| @@ -84,7 +84,9 @@ class SystemCache {
|
| /// temp directory to ensure that it's on the same volume as the pub system
|
| /// cache so that it can move the directory from it.
|
| Future<Directory> createTempDir() {
|
| - return ensureDir(tempDir).then((temp) {
|
| + // Make sure all errors propagate through future.
|
| + return defer(() {
|
| + var temp = ensureDir(tempDir);
|
| return io.createTempDir(join(temp, 'dir'));
|
| });
|
| }
|
| @@ -92,8 +94,9 @@ class SystemCache {
|
| /// Delete's the system cache's internal temp directory.
|
| Future deleteTempDir() {
|
| log.fine('Clean up system cache temp directory $tempDir.');
|
| - return dirExists(tempDir).then((exists) {
|
| - if (!exists) return;
|
| + // Make sure all errors propagate through future.
|
| + return defer(() {
|
| + if (!dirExists(tempDir)) return;
|
| return deleteDir(tempDir);
|
| });
|
| }
|
|
|