Skip to content
Closed
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
12 changes: 9 additions & 3 deletions app/utils/simplecast.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ async function getSeasons({
| SimplecastCollectionResponse<SimpelcastSeasonListItem>
| SimplecastTooManyRequests
if (isTooManyRequests(json)) {
return []
throw new Error(
'Simplecast API rate limit exceeded. Please try again later.',
)
}
const { collection } = json

Expand Down Expand Up @@ -213,7 +215,9 @@ async function getEpisodes(
| SimplecastCollectionResponse<SimplecastEpisodeListItem>
| SimplecastTooManyRequests
if (isTooManyRequests(json)) {
return []
throw new Error(
'Simplecast API rate limit exceeded. Please try again later.',
)
}

const { collection } = json
Expand All @@ -233,7 +237,9 @@ async function getEpisode(episodeId: string) {
| SimplecastEpisode
| SimplecastTooManyRequests
if (isTooManyRequests(json)) {
return null
throw new Error(
'Simplecast API rate limit exceeded. Please try again later.',
)
}

const {
Expand Down