Only show the error when showUser is either not defined, or is true

fixes #128484
This commit is contained in:
isidor 2021-08-16 15:13:15 +02:00
parent 84a8a567e8
commit 29a85f4633
No known key found for this signature in database
GPG key ID: F9280366A8370105
2 changed files with 7 additions and 2 deletions

View file

@ -586,7 +586,10 @@ export class DebugService implements IDebugService {
}
const errorMessage = error instanceof Error ? error.message : error;
await this.showError(errorMessage, errors.isErrorWithActions(error) ? error.actions : []);
if (error.showUser !== false) {
// Only show the error when showUser is either not defined, or is true #128484
await this.showError(errorMessage, errors.isErrorWithActions(error) ? error.actions : []);
}
return false;
}
}

View file

@ -726,8 +726,10 @@ export class RawDebugSession implements IDisposable {
if (error && error.format && error.showUser) {
this.notificationService.error(userMessage);
}
const result = new Error(userMessage);
(<any>result).showUser = error?.showUser;
return new Error(userMessage);
return result;
}
private mergeCapabilities(capabilities: DebugProtocol.Capabilities | undefined): void {