mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35:38 -05:00
Add bindings telemetry (#18851)
* add bindings telemetry * add exitReasons
This commit is contained in:
@@ -23,6 +23,8 @@ export interface IPackageInfo {
|
||||
aiKey: string;
|
||||
}
|
||||
|
||||
export class TimeoutError extends Error { }
|
||||
|
||||
/**
|
||||
* Consolidates on the error message string
|
||||
*/
|
||||
@@ -128,7 +130,7 @@ export function generateQuotedFullName(schema: string, objectName: string): stri
|
||||
export function timeoutPromise(errorMessage: string, ms: number = 10000): Promise<string> {
|
||||
return new Promise((_, reject) => {
|
||||
setTimeout(() => {
|
||||
reject(new Error(errorMessage));
|
||||
reject(new TimeoutError(errorMessage));
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
@@ -173,3 +175,11 @@ export function getPackageInfo(): IPackageInfo {
|
||||
aiKey: packageJson.aiKey
|
||||
};
|
||||
}
|
||||
export function getErrorType(error: any): string | undefined {
|
||||
if (error instanceof TimeoutError) {
|
||||
return 'TimeoutError';
|
||||
} else {
|
||||
return 'UnknownError';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user