Browse Source

analytics: don't initialize handlers if they are not properly configured

master
Saúl Ibarra Corretgé 6 years ago
parent
commit
6bbc2927ab

+ 1
- 6
react/features/analytics/handlers/AmplitudeHandler.js View File

@@ -1,8 +1,6 @@
1 1
 import AbstractHandler from './AbstractHandler';
2 2
 import { amplitude } from './amplitude';
3 3
 
4
-const logger = require('jitsi-meet-logger').getLogger(__filename);
5
-
6 4
 /**
7 5
  * Analytics handler for Amplitude.
8 6
  */
@@ -20,10 +18,7 @@ export default class AmplitudeHandler extends AbstractHandler {
20 18
         const { amplitudeAPPKey, host } = options;
21 19
 
22 20
         if (!amplitudeAPPKey) {
23
-            logger.warn(
24
-                'Failed to initialize Amplitude handler, no APP key');
25
-
26
-            return;
21
+            throw new Error('Failed to initialize Amplitude handler, no APP key');
27 22
         }
28 23
 
29 24
         this._enabled = true;

+ 1
- 7
react/features/analytics/handlers/GoogleAnalyticsHandler.js View File

@@ -4,8 +4,6 @@ import { getJitsiMeetGlobalNS } from '../../base/util';
4 4
 
5 5
 import AbstractHandler from './AbstractHandler';
6 6
 
7
-const logger = require('jitsi-meet-logger').getLogger(__filename);
8
-
9 7
 /**
10 8
  * Analytics handler for Google Analytics.
11 9
  */
@@ -24,11 +22,7 @@ class GoogleAnalyticsHandler extends AbstractHandler {
24 22
         this._userProperties = {};
25 23
 
26 24
         if (!options.googleAnalyticsTrackingId) {
27
-            logger.warn(
28
-                'Failed to initialize Google Analytics handler, no tracking ID'
29
-            );
30
-
31
-            return;
25
+            throw new Error('Failed to initialize Google Analytics handler, no tracking ID');
32 26
         }
33 27
 
34 28
         this._enabled = true;

Loading…
Cancel
Save