From c3fce78013179644dd4929261358d7c7838cac80 Mon Sep 17 00:00:00 2001 From: Julian Bez Date: Tue, 6 Aug 2024 14:57:40 +0200 Subject: [PATCH] Display error when person API fails --- frontend/src/scenes/persons/PersonScene.tsx | 4 ++++ frontend/src/scenes/persons/personsLogic.tsx | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/frontend/src/scenes/persons/PersonScene.tsx b/frontend/src/scenes/persons/PersonScene.tsx index a505eb1125f37..580c47ef67c4f 100644 --- a/frontend/src/scenes/persons/PersonScene.tsx +++ b/frontend/src/scenes/persons/PersonScene.tsx @@ -101,6 +101,7 @@ export function PersonScene(): JSX.Element | null { feedEnabled, person, personLoading, + personError, currentTab, splitMergeModalShown, urlId, @@ -113,6 +114,9 @@ export function PersonScene(): JSX.Element | null { const { groupsEnabled } = useValues(groupsAccessLogic) const { currentTeam } = useValues(teamLogic) + if (personError) { + throw new Error(personError) + } if (!person) { return personLoading ? : } diff --git a/frontend/src/scenes/persons/personsLogic.tsx b/frontend/src/scenes/persons/personsLogic.tsx index 766ca9473dd45..536ff6dfe2b34 100644 --- a/frontend/src/scenes/persons/personsLogic.tsx +++ b/frontend/src/scenes/persons/personsLogic.tsx @@ -202,6 +202,15 @@ export const personsLogic = kea([ loadPerson: () => null, setPerson: (_, { person }): PersonType | null => person, }, + personError: [ + null as string | null, + { + loadPerson: () => null, + setPerson: () => null, + loadPersonUUID: () => null, + loadPersonFailure: (_, { error }) => error, + }, + ], distinctId: [ null as string | null, {