Skip to content

Commit d8a6c43

Browse files
committed
Provide output logs when the process launch fails.
1 parent 59db320 commit d8a6c43

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkgs/dart_mcp_server/lib/src/mixins/flutter_launcher.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,15 @@ base mixin FlutterLauncherSupport
170170
LoggingLevel.info,
171171
'Flutter application ${process!.pid} exited with code $exitCode.',
172172
);
173-
_runningApps.remove(process.pid);
174173
if (!completer.isCompleted) {
174+
final logOutput = _runningApps[process.pid]?.logs.join('\n');
175175
completer.completeError(
176176
'Flutter application exited with code $exitCode before the DTD '
177-
'URI was found.',
177+
'URI was found, with log output:\n$logOutput',
178178
);
179179
}
180+
_runningApps.remove(process.pid);
181+
180182
// Cancel subscriptions after all processing is done.
181183
await stdoutSubscription.cancel();
182184
await stderrSubscription.cancel();

pkgs/dart_mcp_server/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies:
4040
yaml: ^3.1.3
4141

4242
dev_dependencies:
43-
analyzer: ^7.5.2
43+
analyzer: ^8.2.0
4444
dart_flutter_team_lints: ^3.2.1
4545
pub_semver: ^2.2.0
4646
test: ^1.25.15

0 commit comments

Comments
 (0)