vscode-bazel icon indicating copy to clipboard operation
vscode-bazel copied to clipboard

exception on variable evaluation error

Open JayBazuzi opened this issue 5 years ago • 1 comments
trafficstars

If evaluation fails (e.g. user tries to add a watch for a variable that doesn't exist), this line fails:

https://github.com/bazelbuild/vscode-bazel/blob/master/src/debug-adapter/client.ts#L409

    const value = (await this.bazelConnection.sendRequest({
      evaluate: skylark_debugging.EvaluateRequest.create({
        statement: args.expression,
        threadId,
      }),
    })).evaluate.result;

Because evaluate is undefined.

JayBazuzi avatar Jan 28 '20 04:01 JayBazuzi

It looks like DebugEvent.error.message gets "name '{name}' is not defined" in this case, which could be reported to the user.

JayBazuzi avatar Jan 28 '20 04:01 JayBazuzi