diff --git a/apps/desktop/src/lib/components/ProblemLoadingRepo.svelte b/apps/desktop/src/lib/components/ProblemLoadingRepo.svelte index fe38fcd236..15ffd0af96 100644 --- a/apps/desktop/src/lib/components/ProblemLoadingRepo.svelte +++ b/apps/desktop/src/lib/components/ProblemLoadingRepo.svelte @@ -10,6 +10,8 @@ import { getContext } from '@gitbutler/shared/context'; import Icon from '@gitbutler/ui/Icon.svelte'; import Spacer from '@gitbutler/ui/Spacer.svelte'; + import posthog from 'posthog-js'; + import { onMount } from 'svelte'; import { goto } from '$app/navigation'; export let error: any = undefined; @@ -35,6 +37,10 @@ projectsService.reload(); } } + + onMount(() => { + posthog.capture('repo:load_failed', { error_message: String(error) }); + }); diff --git a/apps/desktop/src/lib/vbranches/virtualBranch.ts b/apps/desktop/src/lib/vbranches/virtualBranch.ts index 7f2cf666ac..df9c5176d2 100644 --- a/apps/desktop/src/lib/vbranches/virtualBranch.ts +++ b/apps/desktop/src/lib/vbranches/virtualBranch.ts @@ -1,5 +1,6 @@ import { PatchSeries, VirtualBranch, VirtualBranches } from './types'; import { invoke, listen } from '$lib/backend/ipc'; +import { showError } from '$lib/notifications/toasts'; import { plainToInstance } from 'class-transformer'; import { writable } from 'svelte/store'; import type { BranchListingService } from '$lib/branches/branchListing'; @@ -54,9 +55,10 @@ export class VirtualBranchService { try { this.handlePayload(await this.listVirtualBranches()); this.branchListingService.refresh(); - } catch (err: any) { + } catch (err: unknown) { console.error(err); this.error.set(err); + showError('Failed to load branches', err); } finally { this.loading.set(false); }