Skip to content

Commit

Permalink
Pass back 404 payload for podcast (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
cultpodcasts committed Aug 25, 2024
1 parent 7773c27 commit 6183efb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,9 @@ app.post("/podcast/:id", auth0Middleware, async (c) => {
if (resp.status == 202) {
console.log(`Successfully used secure-podcast-endpoint.`);
return new Response(resp.body);
} else if (resp.status == 404) {
console.log(`Unable to find podcast.`);
return new Response(resp.body, { status: resp.status });
} else {
console.log(`Failed to use secure-podcast-endpoint. Response code: '${resp.status}'.`);
return c.json({ error: "Error" }, 500);
Expand Down

0 comments on commit 6183efb

Please sign in to comment.