File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
lighthouse-core/aggregator Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -77,20 +77,26 @@ class Aggregate {
77
77
typeof expected . rawValue === 'undefined' ||
78
78
typeof expected . weight === 'undefined' ) {
79
79
const msg =
80
- `Config for ${ name } is undefined or does not contain rawValue and weight properties` ;
80
+ `aggregations: ${ name } criteria does not contain expected rawValue or weight properties` ;
81
81
throw new Error ( msg ) ;
82
82
}
83
83
84
84
if ( typeof result === 'undefined' ||
85
85
typeof result . score === 'undefined' ) {
86
- const msg =
87
- `Audit result for ${ name } is undefined or does not contain score property` ;
86
+ let msg =
87
+ `${ name } audit result is undefined or does not contain score property` ;
88
+ if ( result && result . debugString ) {
89
+ msg += ': ' + result . debugString ;
90
+ }
88
91
throw new Error ( msg ) ;
89
92
}
90
93
91
94
if ( typeof result . score !== typeof expected . rawValue ) {
92
- const msg =
95
+ let msg =
93
96
`Expected rawValue of type ${ typeof expected . rawValue } , got ${ typeof result . rawValue } ` ;
97
+ if ( result . debugString ) {
98
+ msg += ': ' + result . debugString ;
99
+ }
94
100
throw new Error ( msg ) ;
95
101
}
96
102
You can’t perform that action at this time.
0 commit comments