How do I catch/log all exceptions in my Pages Functions?
How do I catch/log all exceptions in my Pages Functions?
try...catch next() wrapper: https://github.com/cloudflare/pages-plugins/blob/main/packages/sentry/functions/_middleware.tsgiven object's own enumerable string-keyed property names
headers specifically amongst others.

Object.keys() or console.log()) and they're also on the prototype (so not picked up by Object.getOwnPropertyNames() which looks at the instance) - but there are ways to print out what's on them.console.log a Web API type in Node/Browsers/etc
^1.0.0 (note the ^), then any version compatible with 1.0.0 could be installedfunctions/getFeed.js file are currently@cloudflare/next-on-pages, the functions directory will not work as we generate our own _worker.js instead, and, as such, you should use Next.js Edge API routes instead.
crypto.getHashes has not been implemented yet when i try to deployexport function onRequest(context) {
return new Response(Object.keys(context.request)) // return Empty output
return new Response(Object.keys(context.request.cf)) // Return a lot of properties
}JSON.stringify(req, Object.getOwnPropertyNames(Object.getPrototypeOf(req)), '\t')console.log({
url: req.url,
method: req.method,
...
});for (const property in req) {
console.log(`${property}: ${req[property]}`);
}<html>
<head>
<script src="https://unpkg.com/htmx.org@1.9.4"></script>
<script src="https://unpkg.com/hyperscript.org@0.9.11"></script>
</head>
<script>
function loadIndex() {
console.log('test');
htmx.ajax('GET', '/getFeed', {target: "#swap", headers: {
}})
}
</script>
<body onload="loadIndex()">
...
</body>
</html>export const onRequestGet = () => {
return new Response("Hello, world!")
}import { OpenAI } from 'langchain/llms/openai';
export default defineEventHandler(async e => {
const model = new OpenAI(); //OPENAI_API_KEY set in env
});