File tree 3 files changed +17
-4
lines changed
3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,29 @@ module.exports = async function gatherTelemetry(url) {
9
9
10
10
// Get the "viewport" of the page, as reported by the page.
11
11
const telemetry = await page . evaluate ( ( ) => {
12
+ const SKIPPED_MODULES = [ "fetch/ajax" ] ;
13
+
12
14
/* globals window, Ember */
13
15
let telemetry = { } ;
14
16
15
17
const modules = Object . keys ( window . require . entries ) ;
16
18
17
19
for ( let modulePath of modules ) {
18
- let module = require ( modulePath ) ;
20
+ if ( SKIPPED_MODULES . includes ( modulePath ) ) {
21
+ continue ;
22
+ }
19
23
20
- if ( module && module . default && module . default . proto ) {
21
- let defaultProto = module . default . proto ( ) ;
24
+ try {
25
+ let module = require ( modulePath ) ;
22
26
23
- telemetry [ modulePath ] = parseMeta ( Ember . meta ( defaultProto ) ) ;
27
+ if ( module && module . default && module . default . proto ) {
28
+ let defaultProto = module . default . proto ( ) ;
29
+
30
+ telemetry [ modulePath ] = parseMeta ( Ember . meta ( defaultProto ) ) ;
31
+ }
32
+ } catch ( error ) {
33
+ // log the error, but continue
34
+ console . error ( `error evaluating \`${ modulePath } \`: ${ error . message } ` ) ; // eslint-disable-line no-console
24
35
}
25
36
}
26
37
Original file line number Diff line number Diff line change
1
+ throw new Error ( 'This should not fail the telemetry gathering!' ) ;
Original file line number Diff line number Diff line change
1
+ throw new Error ( 'This should not fail the telemetry gathering!' ) ;
You can’t perform that action at this time.
0 commit comments