Skip to content

Commit 8a4d88f

Browse files
committed
Refine message
1 parent f61dfda commit 8a4d88f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,14 @@ base mixin FlutterLauncherSupport
174174
if (!completer.isCompleted) {
175175
final logs = _runningApps[process.pid]?.logs ?? [];
176176
// Only output the last 500 lines of logs.
177-
final startPos = math.max(0, logs.length - 500);
178-
final logOutput = logs.sublist(startPos).join('\n');
179-
final truncateMessage = startPos > 0
180-
? '[showing the last 500 lines of a log with '
181-
'${logs.length} lines.]...\n'
182-
: '';
177+
final startLine = math.max(0, logs.length - 500);
178+
final logOutput = [
179+
if (startLine > 0) '[skipping $startLine log lines]...',
180+
...logs.sublist(startLine),
181+
];
183182
completer.completeError(
184183
'Flutter application exited with code $exitCode before the DTD '
185-
'URI was found, with log output:\n$truncateMessage$logOutput',
184+
'URI was found, with log output:\n${logOutput.join('\n')}',
186185
);
187186
}
188187
_runningApps.remove(process.pid);

0 commit comments

Comments
 (0)