Skip to content

Commit

Permalink
Add code to test Sentry in CF pages
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyi committed Jan 24, 2025
1 parent 292e879 commit c4bc317
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions functions/_common/reusableHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export async function handleThumbnailRequest(
ctx: EventContext<unknown, any, Record<string, unknown>>,
extension: "png" | "svg"
) {
setTimeout(() => {
throw new Error("Testing Sentry from Cloudflare Functions")
})

const url = new URL(env.url)
const shouldCache = !url.searchParams.has("nocache")

Expand Down
1 change: 1 addition & 0 deletions functions/deleted/[slug].ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Env } from "../_common/env.js"

/** Return a 404 status for tombstones of deleted pages. */
export const onRequestGet: PagesFunction<Env> = async ({ env, request }) => {
throw new Error("Testing Sentry from Cloudflare Functions")
const response = await env.ASSETS.fetch(request)
if (response.redirected || response.status !== 200) return response
return new Response(response.body, {
Expand Down

0 comments on commit c4bc317

Please sign in to comment.