From 78215d826887c5baffb9224f82abde4165ff5eb9 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 19 Jun 2023 12:20:42 +0300 Subject: [PATCH] Skip unaccessible reddits --- Reddit.own | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reddit.own b/Reddit.own index e3f32ca..411e99d 100644 --- a/Reddit.own +++ b/Reddit.own @@ -20,6 +20,6 @@ class Reddit { def fetchSubreddits(subreddits, maxItems = 5) = stream(subreddits) - .flatMap(def(r) = this.fetchSubreddit(r, maxItems)) + .flatMap(def(r) = try(def() = this.fetchSubreddit(r, maxItems), def(clazz, cause) = [])) .toArray() -} \ No newline at end of file +}