mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
correct localise call, fallback to err if no err.message is available, protected message service against invalid items, fixes #5891
This commit is contained in:
parent
4858b5910d
commit
73b97a0642
|
@ -213,7 +213,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
|
|||
electron.fork(modulePath, [], options, (err: any, childProcess: cp.ChildProcess) => {
|
||||
if (err) {
|
||||
this.lastError = err;
|
||||
window.showErrorMessage(localize('serverCouldNotBeStarted', 'TypeScript language server couldn\'t be started. Error message is: {0}'), err.message);
|
||||
window.showErrorMessage(localize('serverCouldNotBeStarted', 'TypeScript language server couldn\'t be started. Error message is: {0}', err.message || err));
|
||||
this.logTelemetry('error', {message: err.message});
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -28,9 +28,11 @@ export class ExtHostMessageService {
|
|||
let command = commands[handle];
|
||||
if (typeof command === 'string') {
|
||||
items.push({ title: command, handle, isCloseAffordance: false });
|
||||
} else {
|
||||
} else if (typeof command === 'object') {
|
||||
let {title, isCloseAffordance} = command;
|
||||
items.push({ title, isCloseAffordance, handle });
|
||||
} else {
|
||||
console.warn('Invalid message item:', command);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue