Skip to content

Commit 9f5112d

Browse files
committed
Add createPost catch block
1 parent 93bd396 commit 9f5112d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

main.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,16 @@ const bot = new LemmyBot.LemmyBot({
235235
let body = ((feed.content && feed.content === 'summary') ? item.summary : item.content);
236236
body = parseTags(body);
237237

238-
await createPost({
239-
name: title,
240-
body: body,
241-
url: item.link || undefined,
242-
community_id: communityId,
243-
});
238+
try {
239+
await createPost({
240+
name: title,
241+
body: body,
242+
url: item.link || undefined,
243+
community_id: communityId,
244+
});
245+
} catch (e) {
246+
console.error(e);
247+
}
244248
await sleep(sleepDuration);
245249
}
246250
}

0 commit comments

Comments
 (0)