From 40bc6b55e48e29befe2c45ef222e38d46e690144 Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Thu, 12 Jan 2023 20:24:20 +0100 Subject: [PATCH] Move debug error message from failed pub to logger.printTrace (#118379) * Move debug error message from failed pub to logger.printTrace * Update test --- packages/flutter_tools/lib/src/dart/pub.dart | 6 ++---- .../flutter_tools/test/general.shard/dart/pub_get_test.dart | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) 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), [