window - log crash reason too

This commit is contained in:
Benjamin Pasero
2021-02-23 10:40:58 +01:00
parent 4ee5bfc4b1
commit 9d1e8fa608
3 changed files with 28 additions and 18 deletions

View File

@@ -933,19 +933,27 @@ export class CodeApplication extends Disposable {
// Observe shared process for errors
const telemetryService = accessor.get(ITelemetryService);
this._register(sharedProcess.onDidError(e => {
this._register(sharedProcess.onDidError(({ type, details }) => {
// Logging
onUnexpectedError(new Error(e.message));
let message: string;
if (typeof details === 'string') {
message = details;
} else {
message = `SharedProcess: crashed (detail: ${details.reason})`;
}
onUnexpectedError(new Error(message));
// Telemetry
type SharedProcessErrorClassification = {
type: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
reason: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
};
type SharedProcessErrorEvent = {
type: WindowError;
reason: string | undefined;
};
telemetryService.publicLog2<SharedProcessErrorEvent, SharedProcessErrorClassification>('sharedprocesserror', { type: e.type });
telemetryService.publicLog2<SharedProcessErrorEvent, SharedProcessErrorClassification>('sharedprocesserror', { type, reason: typeof details !== 'string' ? details.reason : undefined });
}));
// Windows: install mutex