Skip to content

Commit

Permalink
Handle 404 (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
cultpodcasts authored Aug 25, 2024
1 parent 5c71f9b commit 7773c27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,10 @@ app.get("/podcast/:name", auth0Middleware, async (c) => {
});
if (resp.status == 200) {
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 7773c27

Please sign in to comment.