You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/goDebugFactory: respond with error if dlv dap failed to start
DelveDAPOutputAdapter constructor begins spawning of dlv dap
process but it doesn't wait until the dlv dap process is up and
running. The success or failure of dlv dap process launch is
lazily detected when the client sends messages. Previously,
we just sent a TerminatedEvent and pop up an error notification.
This CL changes DelveDAPOutputAdapter to respond with
DebugProtocol.ErrorResponse, so the client can handle the error
- displaying the error with a modal popup
- changing focus so DEBUG CONSOLE becomes visible
And made startAndConnectToServer catches errors and never
throw an error (reject the promise). So, DelveDAPOutputAdapter's
'connected' will never be rejected and explicitly store the error
message. Previously this rejected promise caused warnings, i.e.,
rejected promise not handled within X seconds.
Did some clean up of unnecessary async or declaration.
And, fixed and reenabled logDest tests.
Change-Id: I57b7d52d83a82c506629e07b1dec65f9e02801bc
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/321472
Trust: Hyang-Ah Hana Kim <[email protected]>
Trust: Suzy Mueller <[email protected]>
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
throwerr;// rethrow so the caller knows it failed.
367
+
}
368
+
359
369
constdlvArgs=newArray<string>();
360
370
dlvArgs.push('dap');
361
371
// add user-specified dlv flags first. When duplicate flags are specified,
@@ -379,12 +389,12 @@ async function spawnDlvDapServerProcess(
379
389
380
390
constlogDest=launchArgs.logDest;
381
391
if(typeoflogDest==='number'){
382
-
logErr('Using a file descriptor for `logDest` is not allowed.');
392
+
logErr(`Using a file descriptor for 'logDest' (${logDest}) is not allowed.\n`);
383
393
thrownewError('Using a file descriptor for `logDest` is not allowed.');
384
394
}
385
395
if(logDest&&!path.isAbsolute(logDest)){
386
396
logErr(
387
-
'Using a relative path for `logDest` is not allowed.\nSee [variables](https://code.visualstudio.com/docs/editor/variables-reference)'
397
+
`Using a relative path for 'logDest' (${logDest}) is not allowed.\nSee https://code.visualstudio.com/docs/editor/variables-reference if you want workspace-relative path.\n`
388
398
);
389
399
thrownewError('Using a relative path for `logDest` is not allowed');
390
400
}
@@ -397,14 +407,13 @@ async function spawnDlvDapServerProcess(
0 commit comments