Skip to content

Commit

Permalink
Move debug error message from failed pub to logger.printTrace (#118379)
Browse files Browse the repository at this point in the history
* Move debug error message from failed pub to logger.printTrace

* Update test
  • Loading branch information
sigurdm authored Jan 12, 2023
1 parent 27502f6 commit 40bc6b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions packages/flutter_tools/lib/src/dart/pub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,10 @@ exit code: 66
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
context: PubContext.flutterTests,
),
throwsA(isA<ToolExit>().having((ToolExit error) => error.message, 'message', toolExitMessage)),
throwsA(isA<ToolExit>().having((ToolExit error) => error.message, 'message', null)),
);
expect(logger.statusText, isEmpty);
expect(logger.traceText, contains(toolExitMessage));
expect(
mockStdio.stdout.writes.map(utf8.decode),
<String>[
Expand Down

0 comments on commit 40bc6b5

Please sign in to comment.