Skip to content

Commit bf24ba6

Browse files
committed
More error logging.
1 parent 0b31bea commit bf24ba6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/api/forumAPI.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ export async function getTopic(id: number): Promise<ForumTopic> {
1717
});
1818

1919
if (!response.ok) {
20-
console.error('Error fetching topic:', { body: await response.json() });
21-
throw new Error(`Error fetching topic: ${response.statusText}`);
20+
console.error('Error fetching topic:', { body: (await response.text()).substring(0, 1000) });
2221
}
2322

2423
return await response.json();

src/server/forumWebhook.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default async function forumWebhook(req: express.Request<{}, {}, any>, re
7171
.setAuthor({name: author, iconURL: post.author.photoUrl})
7272
.setURL(url)
7373
.setThumbnail(SUGGESTION_ICON)
74-
.setDescription(`${htmlToText(post.content).substring(0, 2000)}`)
74+
.setDescription(`**${topic.title}**\n\n${htmlToText(post.content).substring(0, 2000)}`)
7575
.setTimestamp(new Date(post.date))
7676
.setFooter({text: `Tags: ${topic.tags.join(', ')}`, iconURL: SUGGESTION_ICON});
7777

0 commit comments

Comments
 (0)