diff --git a/packages/flutter_tools/lib/src/dart/pub.dart b/packages/flutter_tools/lib/src/dart/pub.dart index 94c07ea00314..ffe9ca7cdfeb 100644 --- a/packages/flutter_tools/lib/src/dart/pub.dart +++ b/packages/flutter_tools/lib/src/dart/pub.dart @@ -475,10 +475,8 @@ class _DefaultPub implements Pub { buffer.writeln('command: "${pubCommand.join(' ')}"'); buffer.write(_stringifyPubEnv(pubEnvironment)); buffer.writeln('exit code: $code'); - throwToolExit( - buffer.toString(), - exitCode: code, - ); + _logger.printTrace(buffer.toString()); + throwToolExit(null, exitCode: code); } } diff --git a/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart b/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart index 173a1a7b50eb..97f633ddcafa 100644 --- a/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart +++ b/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart @@ -555,9 +555,10 @@ exit code: 66 project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), context: PubContext.flutterTests, ), - throwsA(isA().having((ToolExit error) => error.message, 'message', toolExitMessage)), + throwsA(isA().having((ToolExit error) => error.message, 'message', null)), ); expect(logger.statusText, isEmpty); + expect(logger.traceText, contains(toolExitMessage)); expect( mockStdio.stdout.writes.map(utf8.decode), [