Skip to content

Commit f60b33a

Browse files
committed
chore: emit diagnostic on iOS record stop runner failure
1 parent c61d73e commit f60b33a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/daemon/handlers/record-trace.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { runIosRunnerCommand } from '../../platforms/ios/runner-client.ts';
77
import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
88
import { SessionStore } from '../session-store.ts';
99
import { ensureDeviceReady } from '../device-ready.ts';
10+
import { emitDiagnostic } from '../../utils/diagnostics.ts';
1011

1112
function getRunnerOptions(req: DaemonRequest, logPath: string | undefined, session: SessionState) {
1213
return {
@@ -112,7 +113,18 @@ export async function handleRecordTraceCommands(params: {
112113
{ command: 'recordStop', appBundleId: activeSession.appBundleId },
113114
getRunnerOptions(req, logPath, activeSession),
114115
);
115-
} catch {
116+
} catch (error) {
117+
emitDiagnostic({
118+
level: 'warn',
119+
phase: 'record_stop_runner_failed',
120+
data: {
121+
platform: device.platform,
122+
kind: device.kind,
123+
deviceId: device.id,
124+
session: activeSession.name,
125+
error: error instanceof Error ? error.message : String(error),
126+
},
127+
});
116128
// best effort: clear runner-backed recording state even if runner stop fails
117129
}
118130
} else {

0 commit comments

Comments
 (0)