Error message for mistype environment variable is confusing
If user make a mistake in the environment variable in launch.json or task.json, for example mistype "${workspaceRoot}" as "${workspace}", the error message user got is confusing:
"Error Cannot read property 'hasOwnProperty' of null."
I can not repro this with the march insider release of VSCode
I tried putting ${workspace} in the program attribute in my launch.json and I get a nice warning
Can you please provide your launch.json for which you get this error message. When do you get this error message?

@isidorn the error message does not make clear that a variable 'workspace' does not exist. Is there a better way to show this error?
@weinand this error is generated by the adapter, so it can massage the error in any way. For showing a squiggle when a user uses an unexisting ${variable} is not supported right now by out json schema.
Throwing an error when we try to substitute an unexisting ${variable} might be possible, but then users will never be able to use ${} syntax in their configuration files. If you believe this is a good approach please file a feature request against Dirk.
@isidorn the debug adapter shouldn't know anything about variables (because that's a frontend/UI concern).
From an end user perspective it would be best if we could show a squiggly in the launch.json when a variable is undefined. Could you do something similar as with the 'path not absolute' warning?
With a path not absolute I use a regex https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/node/debugAdapter.ts#L123
I could introduce the list of the variables we use in systemVariables to this regex but I do not think it is good to introduce this knowledge to the debug world. Thus I would be more comfortable if this lived in where all that knowledge already exists and where we replace those variables - systemVariables.ts
@isidorn yes, I agree, this is not debug specific. It is a very useful feature for any json editor. So please file a feature request for @aeschli.
ping @rick111111
@isidorn: You are right NodeJS debugger don't have this issue.
It turned out that the debug adapter I'm working on returns an error message that directly contains ${wrongvariable} in the string, and also doesn't provide a "wrongvariable" args for string formatting.
The error message I reported is from part/debug/common/debug.ts, function formatPII() throws when it tries to format the string. I'll make a fix on my side. However it will be nice if formatPII() can directly output the string when there is no object to format in args. Or provide some option of not formatting the string.