MCPcopy Create free account
hub / github.com/Snapchat/Valdi / captureLaunch

Method captureLaunch

valdi/vscode_debugger/src/binder.ts:290–322  ·  view source on GitHub ↗

* Launches the debug target, returning any the resolved result. Does a * bunch of mangling to log things, catch uncaught errors, * and format timeouts correctly.

(
    launcher: ILauncher,
    params: AnyLaunchConfiguration,
    cancellationToken: CancellationToken,
  )

Source from the content-addressed store, hash-verified

288 * and format timeouts correctly.
289 */
290 private async captureLaunch(
291 launcher: ILauncher,
292 params: AnyLaunchConfiguration,
293 cancellationToken: CancellationToken,
294 ): Promise<ILaunchResult> {
295 const name = launcher.constructor.name;
296
297 let result: ILaunchResult;
298 try {
299 result = await launcher.launch(params, {
300 telemetryReporter: this._rootServices.get(ITelemetryReporter),
301 cancellationToken,
302 targetOrigin: this._targetOrigin,
303 dap: await this._dap,
304 });
305 } catch (e) {
306 this._rootServices.get<ILogger>(ILogger).warn(LogTag.RuntimeLaunch, 'Launch returned error', {
307 error: e,
308 wasCancelled: cancellationToken.isCancellationRequested,
309 name,
310 });
311
312 throw e;
313 }
314
315 if (result.blockSessionTermination) {
316 this._rootServices
317 .get<ILogger>(ILogger)
318 .info(LogTag.RuntimeLaunch, 'Launched successfully', { name });
319 }
320
321 return result;
322 }
323
324 dispose() {
325 for (const disposable of this._disposables) disposable.dispose();

Callers 1

_launchMethod · 0.95

Calls 4

launchMethod · 0.65
getMethod · 0.65
warnMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected