improve debugging when dart pub get call fails (#112968)
This commit is contained in:
parent
2c0d43e723
commit
559d524ec1
@ -418,7 +418,10 @@ class _DefaultPub implements Pub {
|
|||||||
status?.cancel();
|
status?.cancel();
|
||||||
if (exception is io.ProcessException) {
|
if (exception is io.ProcessException) {
|
||||||
final StringBuffer buffer = StringBuffer('${exception.message}\n');
|
final StringBuffer buffer = StringBuffer('${exception.message}\n');
|
||||||
buffer.writeln('Working directory: "$directory"');
|
final String directoryExistsMessage = _fileSystem.directory(directory).existsSync()
|
||||||
|
? 'exists'
|
||||||
|
: 'does not exist';
|
||||||
|
buffer.writeln('Working directory: "$directory" ($directoryExistsMessage)');
|
||||||
final Map<String, String> env = await _createPubEnvironment(context, flutterRootOverride);
|
final Map<String, String> env = await _createPubEnvironment(context, flutterRootOverride);
|
||||||
buffer.write(_stringifyPubEnv(env));
|
buffer.write(_stringifyPubEnv(env));
|
||||||
throw io.ProcessException(
|
throw io.ProcessException(
|
||||||
|
@ -782,7 +782,7 @@ last line of pub output: "err3"
|
|||||||
isA<ProcessException>().having(
|
isA<ProcessException>().having(
|
||||||
(ProcessException error) => error.message,
|
(ProcessException error) => error.message,
|
||||||
'message',
|
'message',
|
||||||
contains('Working directory: "/"'),
|
contains('Working directory: "/" (exists)'),
|
||||||
).having(
|
).having(
|
||||||
(ProcessException error) => error.message,
|
(ProcessException error) => error.message,
|
||||||
'message',
|
'message',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user