Skip to content

Commit 2224dc5

Browse files
committed
refactor: add error handling for missing URL or podcast_index_id in parseRSSFeedAndSaveToDatabase
1 parent 1cd7bc6 commit 2224dc5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/rss/parser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export const parseRSSFeedAndSaveToDatabase = async (url: string, podcast_index_i
4747
timerManager.start(timerFullRunLabel);
4848

4949
try {
50+
if (!url || !podcast_index_id) {
51+
throw new Error(`parseRSSFeedAndSaveToDatabase: url or podcast_index_id is missing for ${url} ${podcast_index_id}`);
52+
}
5053

5154
loggerService.info(`parseRSSFeedAndSaveToDatabase ${url} ${podcast_index_id}`);
5255
feed = await handleGetRSSFeed(url, podcast_index_id);

0 commit comments

Comments
 (0)