diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 20cba46422..c88cf9c1e6 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -339,14 +339,16 @@ class DevFS { Uri get baseUri => _baseUri; Future create() async { + printTrace('DevFS: Creating new filesystem on the device ($_baseUri)'); _baseUri = await _operations.create(fsName); printTrace('DevFS: Created new filesystem on the device ($_baseUri)'); return _baseUri; } - Future destroy() { + Future destroy() async { + printTrace('DevFS: Deleting filesystem on the device ($_baseUri)'); + await _operations.destroy(fsName); printTrace('DevFS: Deleted filesystem on the device ($_baseUri)'); - return _operations.destroy(fsName); } /// Update files on the device and return the number of bytes sync'd diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 0a88e13b2e..f7188f9b3a 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -226,7 +226,19 @@ abstract class ResidentRunner { throwToolExit('No Flutter view is available'); // Listen for service protocol connection to close. - vmService.done.whenComplete(appFinished); + vmService.done.then( + _serviceProtocolDone, + onError: _serviceProtocolError).whenComplete(appFinished); + } + + Future _serviceProtocolDone(dynamic object) { + printTrace('Service protocol connection closed.'); + return new Future.value(object); + } + + Future _serviceProtocolError(dynamic error, StackTrace stack) { + printTrace('Service protocol connection closed with an error: $error\n$stack'); + return new Future.error(error, stack); } /// Returns [true] if the input has been handled by this function.