Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/commands/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const command: CommandV2 = {
post: newPost,
})
} catch (error) {
console.error(`Error creating post for ${imdbId}:`, error)
messages.push(`Error creating post for \`${imdbId}\``)
seriesList.delete(imdbId)
}
Expand Down
8 changes: 5 additions & 3 deletions src/commands/upcoming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ export const command: CommandV2 = {
break
}
} catch (error) {
if (error instanceof Error) {
return await interaction.editReply(error.message)
}
console.error(`Error fetching upcoming episodes (${subCommand}):`, error)
const message = error instanceof Error
? error.message
: "An unexpected error occurred while fetching upcoming episodes"
return await interaction.editReply(message)
}

if (s == null || s.length === 0) {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/shows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function getAirDate(
timezone,
)
} catch (error) {
console.error(
`Could not parse air date (dateStr=${dateStr}, timeStr=${timeStr}, timezone=${timezone}):`,
error,
)
throw new Error("Could not parse air date")
}
}
Expand Down Expand Up @@ -114,7 +118,7 @@ export async function checkForAiringEpisodes(): Promise<void> {
try {
await updateEpisodes(show.imdbId, show.tvdbId)
} catch (error) {
console.error(`Error updating episodes for ${show.name} (${show.imdbId})`)
console.error(`Error updating episodes for ${show.name} (${show.imdbId}):`, error)
}
}

Expand Down
Loading