From 12c815fde3b9373eb880e7bf1956fdcce90055b3 Mon Sep 17 00:00:00 2001 From: dakedres Date: Tue, 3 Oct 2023 16:54:42 -0400 Subject: [PATCH] 1.0.3 - Improved error handling --- index.js | 14 ++++++++++++-- package.json | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e9ea436..5a36c6f 100644 --- a/index.js +++ b/index.js @@ -249,15 +249,25 @@ const renderImage = image => `\ const main = async () => { const feeds = [] + const subscribe = feedPromise => { + return feedPromise + .catch(error => { + console.error(error) + }) + .then(feed => { + feeds.push(feed) + }) + } + console.log('Grabbing posts...') for(let user of config.feeds.nitter) { - feeds.push(await handleNitterUser(user) ) + await subscribe(handleNitterUser(user) ) } console.log('Caching sources...') Bun.write('cache.json', JSON.stringify(cache, null, 2)) for(let user of config.feeds.tumblr) { - feeds.push(await handleTumblrUser(user) ) + await subscribe(handleTumblrUser(user) ) } await print(feeds) diff --git a/package.json b/package.json index cfb0a1d..77e6624 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rssssing", - "version": "1.0.2", + "version": "1.0.3", "description": "", "main": "index.js", "scripts": {