diff --git a/src/main/lib/github-interface.ts b/src/main/lib/github-interface.ts index ce64f6b..842f270 100644 --- a/src/main/lib/github-interface.ts +++ b/src/main/lib/github-interface.ts @@ -252,21 +252,31 @@ export async function fetchNotificationsForAccount( account, notification ); - const promise = Promise.all([commentPromise, subjectPromise]); + const promise = Promise.all([commentPromise, subjectPromise]).catch( + (err) => { + throw err; + } + ); promises.push(promise); - promise.then(([commentData, subjectData]) => { - notes.push( - buildNoteFromData({ - account, - notification, - subjectData, - commentData, - }) - ); - }); + promise + .then(([commentData, subjectData]) => { + notes.push( + buildNoteFromData({ + account, + notification, + subjectData, + commentData, + }) + ); + }) + .catch((err) => { + throw err; + }); } - await Promise.all(promises); + await Promise.all(promises).catch((err) => { + throw err; + }); return notes; } diff --git a/src/renderer/lib/gitnews-fetcher.ts b/src/renderer/lib/gitnews-fetcher.ts index b8e0f69..c831ab3 100644 --- a/src/renderer/lib/gitnews-fetcher.ts +++ b/src/renderer/lib/gitnews-fetcher.ts @@ -155,12 +155,16 @@ export function createFetcher(): Middleware<{}, AppReduxState> { ); const promise = fetchNotifications(account); promises.push(promise); - promise.then((notes) => { - if ('error' in notes) { - throw notes.error; - } - allNotes = [...allNotes, ...notes]; - }); + promise + .then((notes) => { + if ('error' in notes) { + throw notes.error; + } + allNotes = [...allNotes, ...notes]; + }) + .catch((err) => { + throw new Error(err); + }); } await Promise.all(promises);