[flutter_tools] catch errors when getting cwd (#74744)
This commit is contained in:
@@ -102,7 +102,9 @@ class ErrorHandlingFileSystem extends ForwardingFileSystem {
|
||||
static bool _noExitOnFailure = false;
|
||||
|
||||
@override
|
||||
Directory get currentDirectory => directory(delegate.currentDirectory);
|
||||
Directory get currentDirectory {
|
||||
return _runSync(() => directory(delegate.currentDirectory), platform: _platform);
|
||||
}
|
||||
|
||||
@override
|
||||
File file(dynamic path) => ErrorHandlingFile(
|
||||
@@ -710,7 +712,7 @@ void _handleWindowsException(Exception e, String message, int errorCode) {
|
||||
switch (errorCode) {
|
||||
case kAccessDenied:
|
||||
errorMessage =
|
||||
'$message. The flutter tool cannot access the file.\n'
|
||||
'$message. The flutter tool cannot access the file or directory.\n'
|
||||
'Please ensure that the SDK and/or project is installed in a location '
|
||||
'that has read/write permissions for the current user.';
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user