Skip to content

Commit

Permalink
log status response
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkao committed Jan 29, 2025
1 parent 0748c30 commit cdd751b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/api/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)

const upstream_sentry_url = `https://${SENTRY_HOST}/api/${project_id}/envelope/`;

await fetch(upstream_sentry_url, {
const response = await fetch(upstream_sentry_url, {
method: "POST",
body: envelopeBytes,
headers: {
"Content-Type": "application/octet-stream",
},
});

res.status(200).json({});
console.log(response);

res.status(response.status).json({});
} catch (e) {
console.error("Error tunneling to Sentry:", e);
res.status(500).json({ error: "Error tunneling to Sentry" });
Expand Down

0 comments on commit cdd751b

Please sign in to comment.