Skip to content

Commit 010b155

Browse files
authored
fix: continue if notification enrichment fails (#1572)
Signed-off-by: Adam Setch <[email protected]>
1 parent 67a383c commit 010b155

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/renderer/utils/notifications.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
GitifyState,
66
SettingsState,
77
} from '../types';
8-
import { Notification } from '../typesGitHub';
8+
import { type GitifySubject, Notification } from '../typesGitHub';
99
import { listNotificationsForAuthenticatedUser } from './api/client';
1010
import { determineFailureType } from './api/errors';
1111
import { getAccountUUID } from './auth/utils';
@@ -183,8 +183,16 @@ export async function enrichNotifications(
183183

184184
const enrichedNotifications = await Promise.all(
185185
notifications.map(async (notification: Notification) => {
186-
const additionalSubjectDetails =
187-
await getGitifySubjectDetails(notification);
186+
let additionalSubjectDetails: GitifySubject = {};
187+
188+
try {
189+
additionalSubjectDetails = await getGitifySubjectDetails(notification);
190+
} catch (error) {
191+
log.warn(
192+
`Error occurred while enriching notification ${notification.subject.title} for repository ${notification.repository.full_name}. Continuing with base notification`,
193+
error,
194+
);
195+
}
188196

189197
return {
190198
...notification,

0 commit comments

Comments
 (0)