@@ -18,59 +18,59 @@ class HappyIntegration {
18
18
}
19
19
}
20
20
21
- // class HappyTransport extends Sentry.Transports.BaseTransport {
22
- // captureEvent(event) {
23
- // console.log(
24
- // `This is the place where you'd implement your own sending logic. It'd get url: ${this.url} and an event itself:`,
25
- // event,
26
- // );
27
-
28
- // return {
29
- // status: 'success',
30
- // };
31
- // }
32
- // }
21
+ class HappyTransport extends Sentry . Transports . BaseTransport {
22
+ captureEvent ( event ) {
23
+ console . log (
24
+ `This is the place where you'd implement your own sending logic. It'd get url: ${ this . url } and an event itself:` ,
25
+ event ,
26
+ ) ;
27
+
28
+ return {
29
+ status : 'success' ,
30
+ } ;
31
+ }
32
+ }
33
33
34
34
Sentry . init ( {
35
35
// Client's DSN.
36
- dsn : 'https://2838816694c54bf3973d9b08eeb429c1@dgriesser-7b0957b1732f38a5e205.eu.ngrok. io/11 ' ,
36
+ dsn : 'https://363a337c11a64611be4845ad6e24f3ac@sentry. io/297378 ' ,
37
37
// An array of strings or regexps that'll be used to ignore specific errors based on their type/message
38
- // ignoreErrors: [/PickleRick_\d\d/, " RangeError" ],
39
- // // // An array of strings or regexps that'll be used to ignore specific errors based on their origin url
40
- // blacklistUrls: [" external-lib.js" ],
41
- // // // An array of strings or regexps that'll be used to allow specific errors based on their origin url
42
- // whitelistUrls: [" http://localhost:5000", " https://browser.sentry-cdn" ],
43
- // // // Debug mode with valuable initialization/lifecycle informations.
38
+ ignoreErrors : [ / P i c k l e R i c k _ \d \d / , ' RangeError' ] ,
39
+ // // An array of strings or regexps that'll be used to ignore specific errors based on their origin url
40
+ blacklistUrls : [ ' external-lib.js' ] ,
41
+ // // An array of strings or regexps that'll be used to allow specific errors based on their origin url
42
+ whitelistUrls : [ ' http://localhost:5000' , ' https://browser.sentry-cdn' ] ,
43
+ // // Debug mode with valuable initialization/lifecycle informations.
44
44
debug : true ,
45
45
// Whether SDK should be enabled or not.
46
46
enabled : true ,
47
47
// Custom integrations callback
48
- // integrations(integrations) {
49
- // return [new HappyIntegration(), ...integrations];
50
- // },
48
+ integrations ( integrations ) {
49
+ return [ new HappyIntegration ( ) , ...integrations ] ;
50
+ } ,
51
51
// A release identifier.
52
52
release : '1537345109360' ,
53
53
// An environment identifier.
54
54
environment : 'staging' ,
55
55
// Custom event transport that will be used to send things to Sentry
56
- // transport: HappyTransport,
56
+ transport : HappyTransport ,
57
57
// Method called for every captured event
58
- // async beforeSend(event, hint) {
59
- // // Because beforeSend and beforeBreadcrumb are async, user can fetch some data
60
- // // return a promise, or whatever he wants
61
- // // Our CustomError defined in errors.js has `someMethodAttachedToOurCustomError`
62
- // // which can mimick something like a network request to grab more detailed error info or something.
63
- // // hint is original exception that was triggered, so we check for our CustomError name
64
- // if (hint.originalException.name === 'CustomError') {
65
- // const serverData = await hint.originalException.someMethodAttachedToOurCustomError();
66
- // event.extra = {
67
- // ...event.extra,
68
- // serverData,
69
- // };
70
- // }
71
- // console.log(event);
72
- // return event;
73
- // },
58
+ async beforeSend ( event , hint ) {
59
+ // Because beforeSend and beforeBreadcrumb are async, user can fetch some data
60
+ // return a promise, or whatever he wants
61
+ // Our CustomError defined in errors.js has `someMethodAttachedToOurCustomError`
62
+ // which can mimick something like a network request to grab more detailed error info or something.
63
+ // hint is original exception that was triggered, so we check for our CustomError name
64
+ if ( hint . originalException . name === 'CustomError' ) {
65
+ const serverData = await hint . originalException . someMethodAttachedToOurCustomError ( ) ;
66
+ event . extra = {
67
+ ...event . extra ,
68
+ serverData,
69
+ } ;
70
+ }
71
+ console . log ( event ) ;
72
+ return event ;
73
+ } ,
74
74
// Method called for every captured breadcrumb
75
75
beforeBreadcrumb ( breadcrumb , hint ) {
76
76
// We ignore our own logger and rest of the buttons just for presentation purposes
0 commit comments