mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 09:35:40 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -9,25 +9,40 @@ import { binarySearch } from 'vs/base/common/arrays';
|
||||
import { globals } from 'vs/base/common/platform';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IDisposable, toDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import Errors = require('vs/base/common/errors');
|
||||
import * as Errors from 'vs/base/common/errors';
|
||||
import { safeStringify } from 'vs/base/common/objects';
|
||||
|
||||
/* __GDPR__FRAGMENT__
|
||||
"ErrorEvent" : {
|
||||
"stack": { "classification": "CustomerContent", "purpose": "PerformanceAndHealth" },
|
||||
"message" : { "classification": "CustomerContent", "purpose": "PerformanceAndHealth" },
|
||||
"filename" : { "classification": "CustomerContent", "purpose": "PerformanceAndHealth" },
|
||||
"callstack": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"msg" : { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"file" : { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"line": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth", "isMeasurement": true },
|
||||
"column": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth", "isMeasurement": true },
|
||||
"uncaught_error_name": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"uncaught_error_msg": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"count": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth", "isMeasurement": true }
|
||||
}
|
||||
*/
|
||||
interface ErrorEvent {
|
||||
stack: string;
|
||||
message?: string;
|
||||
filename?: string;
|
||||
callstack: string;
|
||||
msg?: string;
|
||||
file?: string;
|
||||
line?: number;
|
||||
column?: number;
|
||||
error?: { name: string; message: string; };
|
||||
|
||||
uncaught_error_name?: string;
|
||||
uncaught_error_msg?: string;
|
||||
count?: number;
|
||||
}
|
||||
|
||||
namespace ErrorEvent {
|
||||
export function compare(a: ErrorEvent, b: ErrorEvent) {
|
||||
if (a.stack < b.stack) {
|
||||
if (a.callstack < b.callstack) {
|
||||
return -1;
|
||||
} else if (a.stack > b.stack) {
|
||||
} else if (a.callstack > b.callstack) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -89,32 +104,35 @@ export default class ErrorTelemetry {
|
||||
}
|
||||
|
||||
// work around behavior in workerServer.ts that breaks up Error.stack
|
||||
let stack = Array.isArray(err.stack) ? err.stack.join('\n') : err.stack;
|
||||
let message = err.message ? err.message : safeStringify(err);
|
||||
let callstack = Array.isArray(err.stack) ? err.stack.join('\n') : err.stack;
|
||||
let msg = err.message ? err.message : safeStringify(err);
|
||||
|
||||
// errors without a stack are not useful telemetry
|
||||
if (!stack) {
|
||||
if (!callstack) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._enqueue({ message, stack });
|
||||
this._enqueue({ msg, callstack });
|
||||
}
|
||||
|
||||
private _onUncaughtError(message: string, filename: string, line: number, column?: number, err?: any): void {
|
||||
private _onUncaughtError(msg: string, file: string, line: number, column?: number, err?: any): void {
|
||||
|
||||
let data: ErrorEvent = {
|
||||
stack: message,
|
||||
message,
|
||||
filename,
|
||||
callstack: msg,
|
||||
msg,
|
||||
file,
|
||||
line,
|
||||
column
|
||||
};
|
||||
|
||||
if (err) {
|
||||
let { name, message, stack } = err;
|
||||
data.error = { name, message };
|
||||
data.uncaught_error_name = name;
|
||||
if (message) {
|
||||
data.uncaught_error_msg = message;
|
||||
}
|
||||
if (stack) {
|
||||
data.stack = Array.isArray(err.stack)
|
||||
data.callstack = Array.isArray(err.stack)
|
||||
? err.stack = err.stack.join('\n')
|
||||
: err.stack;
|
||||
}
|
||||
@@ -145,16 +163,10 @@ export default class ErrorTelemetry {
|
||||
for (let error of this._buffer) {
|
||||
/* __GDPR__
|
||||
"UnhandledError" : {
|
||||
"message" : { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"name": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"stack": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"id": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"line": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" },
|
||||
"column": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" }
|
||||
"${include}": [ "${ErrorEvent}" ]
|
||||
}
|
||||
*/
|
||||
// __GDPR__TODO__ what's the complete set of properties?
|
||||
this._telemetryService.publicLog('UnhandledError', error);
|
||||
this._telemetryService.publicLog('UnhandledError', error, true);
|
||||
}
|
||||
this._buffer.length = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user