(stdout, commandName)
| 161 | } |
| 162 | |
| 163 | function parseJsonOutput(stdout, commandName) { |
| 164 | const trimmed = stdout.trim(); |
| 165 | if (!trimmed) { |
| 166 | throw new Error(`${commandName} did not print JSON output.`); |
| 167 | } |
| 168 | |
| 169 | try { |
| 170 | return JSON.parse(trimmed); |
| 171 | } catch (error) { |
| 172 | const message = error instanceof Error ? error.message : String(error); |
| 173 | throw new Error(`Unable to parse ${commandName} JSON output: ${message}`); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | function openSimulatorPanel(serverUrl) { |
| 178 | if (simulatorPanel) { |
no test coverage detected