Skip to content
This repository was archived by the owner on Dec 2, 2023. It is now read-only.

Commit 0ef53ec

Browse files
committed
feat: add an error handling
1 parent b5cdd29 commit 0ef53ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ app.event('link_shared', async ({ event, client, logger }) => {
3030
const [, posts, postId] = new URL(link.url).pathname.split('/');
3131
logger.debug({ posts, postId });
3232

33-
const post = await docbase.fetchPost(postId);
33+
const post = await docbase.fetchPost(postId).catch((e) => {
34+
logger.error(e.message);
35+
});
3436
logger.debug(post);
3537
if (!post) {
3638
// Not found

0 commit comments

Comments
 (0)