Add Sentry to capture exceptions and console.error messages, add a checkbox in preference to enable/disable error reporting (#3252)

This commit is contained in:
chh authored and GitHub committed 2021-07-08 19:22:12 +03:00
1 parent 3b31dadf19
commit 05b1a2fc5d
14 files changed
+513 -71

No files matched your search

@@ -106,6 +106,19 @@ const allowTelemetry: PreferenceDescription<boolean> = {
},
};
const allowErrorReporting: PreferenceDescription<boolean> = {
fromStore(val) {
return val ?? true;
},
toStore(val) {
if (val === true) {
return undefined;
}
return val;
},
};
const downloadMirror: PreferenceDescription<string> = {
fromStore(val) {
return val ?? "default";
@@ -227,6 +240,7 @@ export const DESCRIPTORS = {
localeTimezone,
allowUntrustedCAs,
allowTelemetry,
allowErrorReporting,
downloadMirror,
downloadKubectlBinaries,
downloadBinariesPath,
+3
View File
@@ -59,6 +59,7 @@ export class UserStore extends BaseStore<UserStoreModel> /* implements UserStore
@observable seenContexts = observable.set<string>();
@observable newContexts = observable.set<string>();
@observable allowTelemetry: boolean;
@observable allowErrorReporting: boolean;
@observable allowUntrustedCAs: boolean;
@observable colorTheme: string;
@observable localeTimezone: string;
@@ -169,6 +170,7 @@ export class UserStore extends BaseStore<UserStoreModel> /* implements UserStore
this.localeTimezone = DESCRIPTORS.localeTimezone.fromStore(preferences?.localeTimezone);
this.allowUntrustedCAs = DESCRIPTORS.allowUntrustedCAs.fromStore(preferences?.allowUntrustedCAs);
this.allowTelemetry = DESCRIPTORS.allowTelemetry.fromStore(preferences?.allowTelemetry);
this.allowErrorReporting = DESCRIPTORS.allowErrorReporting.fromStore(preferences?.allowErrorReporting);
this.downloadMirror = DESCRIPTORS.downloadMirror.fromStore(preferences?.downloadMirror);
this.downloadKubectlBinaries = DESCRIPTORS.downloadKubectlBinaries.fromStore(preferences?.downloadKubectlBinaries);
this.downloadBinariesPath = DESCRIPTORS.downloadBinariesPath.fromStore(preferences?.downloadBinariesPath);
@@ -188,6 +190,7 @@ export class UserStore extends BaseStore<UserStoreModel> /* implements UserStore
localeTimezone: DESCRIPTORS.localeTimezone.toStore(this.localeTimezone),
allowUntrustedCAs: DESCRIPTORS.allowUntrustedCAs.toStore(this.allowUntrustedCAs),
allowTelemetry: DESCRIPTORS.allowTelemetry.toStore(this.allowTelemetry),
allowErrorReporting: DESCRIPTORS.allowErrorReporting.toStore(this.allowErrorReporting),
downloadMirror: DESCRIPTORS.downloadMirror.toStore(this.downloadMirror),
downloadKubectlBinaries: DESCRIPTORS.downloadKubectlBinaries.toStore(this.downloadKubectlBinaries),
downloadBinariesPath: DESCRIPTORS.downloadBinariesPath.toStore(this.downloadBinariesPath),