Skip to content

Commit 705de3d

Browse files
committed
debug: surface all errors from the variable substitution via modal dialogs
fixes microsoft#46870
1 parent 433006e commit 705de3d

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,13 @@ class Launch implements ILaunch {
634634
setOSProperties(isLinux, result.linux);
635635

636636
// massage configuration attributes - append workspace path to relatvie paths, substitute variables in paths.
637-
Object.keys(result).forEach(key => {
638-
result[key] = this.configurationResolverService.resolveAny(this.getWorkspaceForResolving(), result[key]);
639-
});
637+
try {
638+
Object.keys(result).forEach(key => {
639+
result[key] = this.configurationResolverService.resolveAny(this.getWorkspaceForResolving(), result[key]);
640+
});
641+
} catch (e) {
642+
return TPromise.wrapError(e);
643+
}
640644

641645
const adapter = this.configurationManager.getDebugger(result.type);
642646
return this.configurationResolverService.resolveInteractiveVariables(result, adapter ? adapter.variables : null);

src/vs/workbench/parts/debug/electron-browser/debugService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ export class DebugService implements debug.IDebugService {
786786

787787
private createProcess(launch: debug.ILaunch, config: debug.IConfig, sessionId: string): TPromise<void> {
788788
return this.textFileService.saveAll().then(() =>
789-
(launch ? launch.substituteVariables(config) : TPromise.as(config)).then(resolvedConfig => {
789+
(launch ? launch.substituteVariables(config).then(config => config, (err: Error) => this.showError(err.message)) : TPromise.as(config)).then(resolvedConfig => {
790790
if (!resolvedConfig) {
791791
// User canceled resolving of interactive variables, silently return
792792
return undefined;

0 commit comments

Comments
 (0)