File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
docs/platforms/javascript/guides/cloudflare Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,25 @@ export default Sentry.withSentry(
105
105
);
106
106
```
107
107
108
+ If you do not have access to the ` onRequest ` middleware API, you can use the ` wrapRequestHandler ` API instead. For example:
109
+
110
+ ``` javascript
111
+ // hooks.server.js
112
+ import * as Sentry from ' @sentry/cloudflare' ;
113
+
114
+ export const handle = ({ event , resolve }) => {
115
+ const requestHandlerOptions = {
116
+ options: {
117
+ dsn: event .platform .env .SENTRY_DSN ,
118
+ tracesSampleRate: 1.0 ,
119
+ },
120
+ request: event .request ,
121
+ context: event .platform .ctx ,
122
+ };
123
+ return Sentry .wrapRequestHandler (requestHandlerOptions, () => resolve (event ));
124
+ };
125
+ ```
126
+
108
127
## Add Readable Stack Traces to Errors
109
128
110
129
Depending on how you've set up your project, the stack traces in your Sentry errors probably don't look like your actual code.
You can’t perform that action at this time.
0 commit comments