diff --git a/src/brain/gocdSlackFeeds/index.ts b/src/brain/gocdSlackFeeds/index.ts index 2d6d98f7..3c95e127 100644 --- a/src/brain/gocdSlackFeeds/index.ts +++ b/src/brain/gocdSlackFeeds/index.ts @@ -283,7 +283,7 @@ const engineeringFeed = new DeployFeed({ }); export async function handler(body: GoCDResponse) { - await Promise.all([ + const promises = [ deployFeed.handle(body), devinfraFeed.handle(body), snsSaaSFeed.handle(body), @@ -292,7 +292,14 @@ export async function handler(body: GoCDResponse) { engineeringFeed.handle(body), snsS4SK8sFeed.handle(body), snsSaaSK8sFeed.handle(body), - ]); + ]; + // Don't fail the entire handler if one of the feeds fails + const results = await Promise.allSettled(promises); + results.forEach((result) => { + if (result.status === 'rejected' && result.reason instanceof Error) { + Sentry.captureException(result.reason); + } + }); } export async function gocdSlackFeeds() {