Unverified Commit 40bc6b55 authored by Sigurd Meldgaard's avatar Sigurd Meldgaard Committed by GitHub

Move debug error message from failed pub to logger.printTrace (#118379)

* Move debug error message from failed pub to logger.printTrace

* Update test
parent 27502f68
...@@ -475,10 +475,8 @@ class _DefaultPub implements Pub { ...@@ -475,10 +475,8 @@ class _DefaultPub implements Pub {
buffer.writeln('command: "${pubCommand.join(' ')}"'); buffer.writeln('command: "${pubCommand.join(' ')}"');
buffer.write(_stringifyPubEnv(pubEnvironment)); buffer.write(_stringifyPubEnv(pubEnvironment));
buffer.writeln('exit code: $code'); buffer.writeln('exit code: $code');
throwToolExit( _logger.printTrace(buffer.toString());
buffer.toString(), throwToolExit(null, exitCode: code);
exitCode: code,
);
} }
} }
......
...@@ -555,9 +555,10 @@ exit code: 66 ...@@ -555,9 +555,10 @@ exit code: 66
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
context: PubContext.flutterTests, 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.statusText, isEmpty);
expect(logger.traceText, contains(toolExitMessage));
expect( expect(
mockStdio.stdout.writes.map(utf8.decode), mockStdio.stdout.writes.map(utf8.decode),
<String>[ <String>[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment