File tree Expand file tree Collapse file tree 1 file changed +51
-9
lines changed Expand file tree Collapse file tree 1 file changed +51
-9
lines changed Original file line number Diff line number Diff line change @@ -286,12 +286,38 @@ _Old_:
286
286
``` js
287
287
Raven .config (' ___PUBLIC_DSN___' , {
288
288
shouldSendCallback (event ) {
289
- // Modify the event here
290
- if (event .user ){
289
+ // Only send events that include user data
290
+ if (event .user ){
291
+ return true ;
292
+ }
293
+ return false ;
294
+ }
295
+ });
296
+ ```
297
+
298
+ _ New_ :
299
+
300
+ ``` js
301
+ Sentry .init ({
302
+ beforeSend (event ) {
303
+ if (event .user ) {
304
+ return event ;
305
+ }
306
+ return null
307
+ }
308
+ });
309
+ ```
310
+
311
+ ### Modifying Events (` dataCallback ` )
312
+
313
+ _ Old_ :
314
+
315
+ ``` js
316
+ Raven .config (' ___PUBLIC_DSN___' , {
317
+ dataCallback (event ) {
318
+ if (event .user ) {
291
319
// Don't send user's email address
292
320
delete event .user .email ;
293
- } else {
294
- return false ; // don't send this event
295
321
}
296
322
return event ;
297
323
}
@@ -303,12 +329,8 @@ _New_:
303
329
``` js
304
330
Sentry .init ({
305
331
beforeSend (event ) {
306
- // Modify the event here
307
- if (event .user ){
308
- // Don't send user's email address
332
+ if (event .user ) {
309
333
delete event .user .email ;
310
- } else {
311
- return null ; // don't send this event
312
334
}
313
335
return event ;
314
336
}
@@ -334,3 +356,23 @@ Sentry.init({
334
356
attachStacktrace: true ,
335
357
});
336
358
```
359
+
360
+ ### Disabling Promises Handling
361
+
362
+ _ Old_ :
363
+
364
+ ``` js
365
+ Raven .config (' ___PUBLIC_DSN___' , {
366
+ captureUnhandledRejections: false ,
367
+ });
368
+ ```
369
+
370
+ _ New_ :
371
+
372
+ ``` js
373
+ Sentry .init ({
374
+ integrations: [new Sentry.Integrations.GlobalHandlers ({
375
+ onunhandledrejection: false
376
+ })]
377
+ })
378
+ ```
You can’t perform that action at this time.
0 commit comments