Fix ts server potentially logging unknown error code in some cases

This commit is contained in:
Matt Bierner 2017-04-26 17:17:32 -07:00
parent d6dcd7d5fc
commit 38b4b14fb6

View file

@ -610,7 +610,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
this.serviceExited(false);
});
childProcess.on('exit', (code: any) => {
this.error(`TSServer exited with code: ${code ? code : 'unknown'}`);
this.error(`TSServer exited with code: ${code === null || typeof code === 'undefined' ? 'unknown' : code}`);
if (this.tsServerLogFile) {
this.error(`TSServer log file: ${this.tsServerLogFile}`);
}