Fix casing of error when Dart compiler is interrupted (#167520)

You see this error if you do a well timed `Ctrl+C` during a `flutter
run`
This commit is contained in:
Loïc Sharma 2025-04-22 13:50:19 -07:00 committed by GitHub
parent 69c5526b23
commit 127faefdf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -891,7 +891,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
// process has died unexpectedly. // process has died unexpectedly.
if (_stdoutHandler.compilerOutput?.isCompleted == false) { if (_stdoutHandler.compilerOutput?.isCompleted == false) {
_stdoutHandler.compilerOutput?.complete(); _stdoutHandler.compilerOutput?.complete();
throwToolExit('the Dart compiler exited unexpectedly.'); throwToolExit('The Dart compiler exited unexpectedly.');
} }
}, },
); );
@ -904,7 +904,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
unawaited( unawaited(
_server?.exitCode.then((int code) { _server?.exitCode.then((int code) {
if (code != 0) { if (code != 0) {
throwToolExit('the Dart compiler exited unexpectedly.'); throwToolExit('The Dart compiler exited unexpectedly.');
} }
}), }),
); );

View File

@ -612,7 +612,7 @@ resolution: workspace
onError: (Object error) async { onError: (Object error) async {
expect(error, isA<ToolExit>()); expect(error, isA<ToolExit>());
// We expect this message because we are using a fake ProcessManager. // We expect this message because we are using a fake ProcessManager.
expect((error as ToolExit).message, contains('the Dart compiler exited unexpectedly.')); expect((error as ToolExit).message, contains('The Dart compiler exited unexpectedly.'));
caughtToolExit = true; caughtToolExit = true;
final File isolateSpawningTesterPackageConfigFile = fs final File isolateSpawningTesterPackageConfigFile = fs
@ -694,7 +694,7 @@ resolution: workspace
onError: (Object error) async { onError: (Object error) async {
expect(error, isA<ToolExit>()); expect(error, isA<ToolExit>());
// We expect this message because we are using a fake ProcessManager. // We expect this message because we are using a fake ProcessManager.
expect((error as ToolExit).message, contains('the Dart compiler exited unexpectedly.')); expect((error as ToolExit).message, contains('The Dart compiler exited unexpectedly.'));
caughtToolExit = true; caughtToolExit = true;
final File childTestIsolateSpawnerSourceFile = fs final File childTestIsolateSpawnerSourceFile = fs
@ -761,7 +761,7 @@ const List<String> packageTestArgs = <String>[
onError: (Object error) async { onError: (Object error) async {
expect(error, isA<ToolExit>()); expect(error, isA<ToolExit>());
// We expect this message because we are using a fake ProcessManager. // We expect this message because we are using a fake ProcessManager.
expect((error as ToolExit).message, contains('the Dart compiler exited unexpectedly.')); expect((error as ToolExit).message, contains('The Dart compiler exited unexpectedly.'));
caughtToolExit = true; caughtToolExit = true;
final File childTestIsolateSpawnerSourceFile = fs final File childTestIsolateSpawnerSourceFile = fs

View File

@ -191,7 +191,7 @@ void main() {
projectRootPath: '', projectRootPath: '',
), ),
), ),
throwsToolExit(message: 'the Dart compiler exited unexpectedly.'), throwsToolExit(message: 'The Dart compiler exited unexpectedly.'),
); );
}, },
); );