Skip to content

Failure message from Variables request to debugger extension is not surfaced #85645

Closed

Description

Issue Type: Bug

Similar to #80464.

The code at

private async fetchVariables(start: number | undefined, count: number | undefined, filter: 'indexed' | 'named' | undefined): Promise<Variable[]> {
try {
const response = await this.session!.variables(this.reference || 0, this.threadId, filter, start, count);
return response && response.body && response.body.variables
? distinct(response.body.variables.filter(v => !!v && isString(v.name)), (v: DebugProtocol.Variable) => v.name).map((v: DebugProtocol.Variable) =>
new Variable(this.session, this.threadId, this, v.variablesReference, v.name, v.evaluateName, v.value, v.namedVariables, v.indexedVariables, v.presentationHint, v.type))
: [];
} catch (e) {
return [new Variable(this.session, this.threadId, this, 0, e.message, e.message, '', 0, 0, { kind: 'virtual' }, undefined, false)];
}
}
caters for an exception thrown by a debugging extension. But they never do that. What they do is return response.success: false and a message in response.message

VS Code version: Code - Insiders 1.41.0-insider (a8158ae, 2019-11-26T21:13:19.311Z)
OS version: Windows_NT x64 10.0.17763

Activity

  1. isidorn commented on Nov 28, 2019

    @isidorn

    John Murray (@gjsjohnmurray) Good catch!
    Would you be willing to provide a PR that fixes this? The PR should check the response.success and if it is false also return the dummy Variable which would hold the error message.

  2. added
    bug
    debug
    help wanted
    on Nov 28, 2019
  3. added 2 commits that reference this issue on Nov 29, 2019
  4. gjsjohnmurray commented on Nov 29, 2019

    @gjsjohnmurray
    ContributorAuthor

    My initial diagnosis was incorrect, and the fix (see PR) turned out to be trivial.

  5. added a commit that references this issue on Dec 11, 2019
  6. locked and limited conversation to collaborators on Jan 25, 2020
  7. weinand commented on Jan 30, 2020

    @weinand
    Contributor

    If the variable request returns an error response 'foo bar' it shows up in the UI as:

    2020-01-30_14-18-43

    To emphasize that this is an error I suggest a change to the error format: don't show the leading space and the colon ':', just show the error message.

  8. added
    verified
    and removed
    help wanted
    on Jan 30, 2020
  9. isidorn commented on Jan 30, 2020

    @isidorn

    Andre Weinand (@weinand) yes, this makes perfect sense. So this does not get lost I have created issue for next milestone #89709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdebugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions