Skip to content

Commit bf4d30d

Browse files
authored
Merge branch 'master' into abhi/build/ignore-react-typedoc
2 parents b7baedd + a6b67ab commit bf4d30d

File tree

1 file changed

+51
-9
lines changed

1 file changed

+51
-9
lines changed

MIGRATION.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,38 @@ _Old_:
286286
```js
287287
Raven.config('___PUBLIC_DSN___', {
288288
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) {
291319
// Don't send user's email address
292320
delete event.user.email;
293-
} else {
294-
return false; // don't send this event
295321
}
296322
return event;
297323
}
@@ -303,12 +329,8 @@ _New_:
303329
```js
304330
Sentry.init({
305331
beforeSend(event) {
306-
// Modify the event here
307-
if(event.user){
308-
// Don't send user's email address
332+
if (event.user) {
309333
delete event.user.email;
310-
} else {
311-
return null; // don't send this event
312334
}
313335
return event;
314336
}
@@ -334,3 +356,23 @@ Sentry.init({
334356
attachStacktrace: true,
335357
});
336358
```
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+
```

0 commit comments

Comments
 (0)