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

Commit 46d4bd6

Browse files
committed
fix: add an error handling
1 parent 3479eef commit 46d4bd6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ app.event('link_shared', async ({ event, client, logger }) => {
5353
footer: 'Tags: ' + post.tags.map((v) => v.name).join(', '),
5454
ts: dayjs(post.updated_at).unix().toString(),
5555
};
56-
await client.chat.unfurl({
57-
channel: event.channel,
58-
ts: event.message_ts,
59-
unfurls: { [post.url]: attachment },
60-
});
56+
await client.chat
57+
.unfurl({
58+
channel: event.channel,
59+
ts: event.message_ts,
60+
unfurls: { [post.url]: attachment },
61+
})
62+
.catch((e) => {
63+
logger.error(e.message);
64+
});
6165
}
6266
});
6367

0 commit comments

Comments
 (0)